Add meow example cli program
This commit is contained in:
parent
a5c30d6f3d
commit
28f734d8dc
|
@ -0,0 +1,10 @@
|
|||
[package]
|
||||
name = "meow"
|
||||
version = "0.1.0"
|
||||
authors = ["Timothy Warren <twarren@nabancard.com>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
clap = "2.33.0"
|
|
@ -0,0 +1,21 @@
|
|||
#[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);
|
||||
}
|
Loading…
Reference in New Issue