tutorials/rust/meow/src/main.rs

22 lines
675 B
Rust

#[macro_use]
extern crate clap;
fn main() {
let matches = clap_app!(myapp =>
(version: "1.0")
(author: env!("CARGO_PKG_AUTHORS"))
(about: "Does awesome things")
(@arg config: -c --config +takes_value "Sets a custom config file")
(@arg INPUT: +required "Sets the input file to use")
(@arg verbose: -v ... "Sets the level of verbosity")
(@subcommand test =>
(about: "controls testing features")
(version: "1.3")
(author: "Someone E. <someone_else@other.com>")
(@arg debug: -d "print debug information")
)
).get_matches();
println!("{:?}", matches);
}