summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-10-28 15:44:21 +0200
committerLars Wirzenius <liw@liw.fi>2018-10-28 15:44:21 +0200
commitaa51e17f0252da3760bdf7b3e883a1955f9ce8dd (patch)
treec159079ef777b9b5621eb8bf6c5f9f00ec77367e /src/main.rs
downloadicktool-rs-aa51e17f0252da3760bdf7b3e883a1955f9ce8dd.tar.gz
Initial commit
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs29
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");
+}