mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
24 lines
874 B
Rust
24 lines
874 B
Rust
|
extern crate clap;
|
||
|
|
||
|
use clap::{App};
|
||
|
|
||
|
fn main() {
|
||
|
|
||
|
// Apps describe the top level application
|
||
|
//
|
||
|
// call .get_matches() last in order to find all valid command line arguments that supplied by
|
||
|
// the user at runtime. The name given to new() will be displayed when the version or help
|
||
|
// flags are used.
|
||
|
//
|
||
|
// The options (version(), author(), about()) aren't mandatory, but recommended. There is another
|
||
|
// option, usage(), which is an exception to the rule. This should only be used when the default
|
||
|
// usage string generated by clap doesn't suffice.
|
||
|
let matches = App::new("MyApp")
|
||
|
.version("1.0")
|
||
|
.author("Kevin K. <kbknapp@gmail.com>")
|
||
|
.about("Does awesome things")
|
||
|
.get_matches();
|
||
|
|
||
|
// Continued program logic goes here...
|
||
|
}
|