Expand description
§Command Line Parse
cl_parse is a library that allows you to define commandline options and arguments and then
parse the commandline arguments based on that definition.
§Motivation
cl_parse was developed to allow the most common commandline options that are used in
modern commandline utilities. It was also designed for ease of use. The following are the features
implemented in cl_parse:
- option aliases, e.g.,
vec!["-f", "--file"] - options with negative values, e.g.,
--increment -1 - option default value
- option valid values, e.g., for –optimize valid values
vec!["1","2","3"] - flag concatenation, e.g.,
-xvgfinstead of-x -v -g -f - Auto usage message generation
- Auto help message generation
-h,--helpoutput provided by default- missing value detection for options
- ability to define required options
- option and argument validation, i.e., only defined options and arguments can be used.
- unordered options and arguments
- retrieving the option or argument in the target type, e.g.,
i32,String, etc.
§Examples
Structs§
- Command
Line - Stores the parsed command line
- Command
Line Def - Defines the valid commandline options and arguments for this program