Expand description
This command line parser is based on a C++ command line parser which is based on a C command line parser which in turn was inspired by the Python argparse module.
The basic use pattern for qargparser is:
- Create a context struct for storing parser output.
- Create one or more
Builder. - Create
Specobjects from theBuilderobjects by callingBuilder::build(), passing a function for processing the option/argument. - Create a
Parserobject (Parser::from_env()orParser::from_args()) handing over the ownership of a parser context struct. - Add the
Specobjects to the parser object usingParser::add(). - Call the parser.
- At this point, if successful, the parser context should be populated
with data from the command line. Call
Parser::into_ctx()to regain ownership of the context.
One of the minor goals of qargparser is to simplify reuse of option/argument specs between parsers.
§ToDo
- Currently converts argument strings to UTF-8. Should support
OsStr(ing).
Structs§
- Builder
- Parser option/argument specification builder.
- Parser
- The core parser.
- Spec
- Option/argument specification.