Add meow example cli program

This commit is contained in:
Timothy Warren 2019-08-07 15:59:21 -04:00
parent a5c30d6f3d
commit 28f734d8dc
2 changed files with 31 additions and 0 deletions

10
rust/meow/Cargo.toml Normal file
View File

@ -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"

21
rust/meow/src/main.rs Normal file
View File

@ -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);
}