clap
or Command Line Argument Parser
Is a simple-to-use, efficient, and fully-configurable library for parsing command line arguments.
clap
supports advanced features like argument relationships, subcommands, and much, much more.
A Quick Taste
The following Rust code is all it takes to get started:
1 2 3 4 5 6 7 8 9 10 |
extern crate clap; use clap::App; fn main() { App::new("myapp") .version("1.0") .about("Does great things!") .author("Kevin K.") .get_matches(); } |
If the user runs $ myapp --help the following would be printed
1 2 3 4 5 6 7 8 9 10 11 |
$ myapp --help myapp 1.0 Kevin K. Does great things! USAGE: myapp [FLAGS] FLAGS: -h, --help Prints this message -V, --version Prints version information |