diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..ccae56f --- /dev/null +++ b/src/main.rs @@ -0,0 +1,29 @@ +#[macro_use] +extern crate clap; +use clap::App; + +fn main() { + let yaml = load_yaml!("icktool.yaml"); + let matches = App::from_yaml(yaml).get_matches(); + + if let Some(api) = matches.value_of("api") { + println!("api: {}", api); + } + + if let Some(_) = matches.subcommand_matches("version") { + version(); + } else if let Some(_) = matches.subcommand_matches("status") { + status(); + } else { + eprintln!("no action taken!"); + std::process::exit(1); + } +} + +fn version() { + println!("status requested"); +} + +fn status() { + println!("status requested"); +} |