[−][src]Crate arguably
A minimalist library for parsing command line arguments.
Features
-
Long-form boolean flags with single-character shortcuts:
--flag
,-f
. -
Long-form string-valued options with single-character shortcuts:
--option <arg>
,-o <arg>
. -
Condensed short-form options:
-abc <arg> <arg>
. -
Automatic
--help
and--version
flags. -
Support for multivalued options.
-
Support for git-style command interfaces with arbitrarily-nested commands.
Example
let mut parser = ArgParser::new() .helptext("Usage: foobar...") .version("1.0") .flag("foo f") .option("bar b"); if let Err(err) = parser.parse() { err.exit(); } if parser.found("foo").unwrap() { println!("Found --foo/-f flag."); } if let Some(value) = parser.value("bar").unwrap() { println!("Found --bar/-b option with value: {}", value); } for arg in parser.args() { println!("Arg: {}", arg); }
Structs
ArgParser | An ArgParser instance can be intialized using the builder pattern. |
Enums
Error | Covers all types of error returned by the library. |