~gbmor/clinte

b50586f991c1414cb322413a9b8a73fe40a104f5 — Ben Morrison 1 year, 10 months ago 70a0c68 v0.4.1
fixed subcommands
3 files changed, 6 insertions(+), 10 deletions(-)

M Cargo.lock
M Cargo.toml
M src/main.rs
M Cargo.lock => Cargo.lock +1 -1
@@ 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)",

M Cargo.toml => Cargo.toml +1 -1
@@ 1,6 1,6 @@
[package]
name = "clinte"
version = "0.4.0"
version = "0.4.1"
authors = ["Ben Morrison <ben@gbmor.dev>"]
edition = "2018"


M src/main.rs => src/main.rs +4 -8
@@ 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 {