diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-09-04 18:33:40 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-09-04 18:33:40 -0400 |
commit | b50586f991c1414cb322413a9b8a73fe40a104f5 (patch) | |
tree | 3b316cb058d8340283a4026ef2a489cf89302a7b | |
parent | 70a0c68e72e2602c89df0280f41de32441577a67 (diff) | |
download | clinte-b50586f991c1414cb322413a9b8a73fe40a104f5.tar.gz |
fixed subcommands v0.4.1
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/main.rs | 12 |
3 files changed, 6 insertions, 10 deletions
diff --git a/Cargo.lock b/Cargo.lock index e4cc6e1..62411da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -119,7 +119,7 @@ dependencies = [ [[package]] name = "clinte" -version = "0.4.0" +version = "0.4.1" dependencies = [ "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 3e53b9f..a722af2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clinte" -version = "0.4.0" +version = "0.4.1" authors = ["Ben Morrison <ben@gbmor.dev>"] edition = "2018" diff --git a/src/main.rs b/src/main.rs index 35df02f..f003a5b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,12 +19,8 @@ fn main() { .author("Ben Morrison (gbmor)") .about("Command-line community notices system") .subcommand(clap::SubCommand::with_name("post").about("Post a new notice")) - .subcommand( - clap::SubCommand::with_name("update_handler").about("Update a notice you've posted"), - ) - .subcommand( - clap::SubCommand::with_name("delete_handler").about("Delete a notice you've posted"), - ) + .subcommand(clap::SubCommand::with_name("update").about("Update a notice you've posted")) + .subcommand(clap::SubCommand::with_name("delete").about("Delete a notice you've posted")) .get_matches(); let start = time::Instant::now(); @@ -41,7 +37,7 @@ fn main() { if arg_matches.subcommand_matches("post").is_some() { info!("New post..."); posts::create(&db); - } else if arg_matches.subcommand_matches("update_handler").is_some() { + } else if arg_matches.subcommand_matches("update").is_some() { let id: u32 = if let Some(val) = arg_matches.subcommand_matches("update_handler") { val.value_of("id").unwrap().parse().unwrap() } else { @@ -49,7 +45,7 @@ fn main() { }; info!("Updating post ..."); posts::update_handler(&db, id); - } else if arg_matches.subcommand_matches("delete_handler").is_some() { + } else if arg_matches.subcommand_matches("delete").is_some() { let id: u32 = if let Some(val) = arg_matches.subcommand_matches("update_handler") { val.value_of("id").unwrap().parse().unwrap() } else { |