[][src]Crate qargparser

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:

  1. Create a context struct for storing parser output.
  2. Create one or more Builder.
  3. Create Spec objects from the Builder objects by calling Builder::build(), passing a function for processing the option/argument.
  4. Create a Parser object (Parser::from_env() or Parser::from_args()) handing over the ownership of a parser context struct.
  5. Add the Spec objects to the parser object using Parser::add().
  6. Call the parser.
  7. 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.

Enums

ErrKind
Nargs