Releases: tiborsimon/simple-input-parser
Releases · tiborsimon/simple-input-parser
Simple Input Parser v2.0.0
Changes
- Fully reworked bulk mode handling
- New, cleaner error handling
- Flag mode removed, only extra flag mode will be available
- Release package is packaged with the new MATLAB Library System v2.3.0
Simple Input Parser v1.4.1
Changes
- README.md links updated
Simple Input Parser v1.4.0
Changes
- Removed MATLAB Library System integration at repo level. Only the release is wrapped around with the library system.
- Small typo correction
Simple Input Parser v1.3
Modifications
- MATLAB Library System added
- Demo mode added with by calling with parameters
Extra flag mode and custom validator error message support added
Extra flag mode
From now, you can ask for a flag structure any time by using a second output variable during the parser API function call:
function ret = my_function( varargin )
params.a = 0;
params.b = 0;
params.c = 0;
[params, flags] = simple_input_parser(flags, varargin);
% if a value was parsed, it's corresponding field in the flags structure will
% be assigned to one unlike the previous flag mode, it is not necessary to
% truncate the varargin parameter to it's firts element the flag generation
% will work during other modes as well
% further functionalities
end
Cutom validator error message
A minor upgrade was applied to the custom validator functions as well for supporting custom error messages.
IMPORTANT : error messages are mandatory output variables for the validator functions
function ret = my_function( varargin )
params.a = 0;
params.b = 0;
params.c = 0;
function [validflag, errormsg] = validate_c(value)
errormsg = 'Parameter c has to be greater than 1..';
validflag = value > 1;
end
validators.b = @validate_c;
params = simple_input_parser(params, varargin, validators);
% further functionalities
end
[Bug] Extra flag mode and custom validator error message support added
v1.1 Update README.md
Initial MATLAB port
This release contains the initial MATLAB port. Further ports are coming soon.