From 99c5537622344ecba5a4c7d23a9bc227d9bd7fe3 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Tue, 26 May 2020 23:47:52 -0400 Subject: post ID can be specified as an argument. if absent, user will be prompted --- src/conf.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/conf.rs') diff --git a/src/conf.rs b/src/conf.rs index dd3b298..2a26a92 100644 --- a/src/conf.rs +++ b/src/conf.rs @@ -17,7 +17,25 @@ fn get_config() -> clap::ArgMatches<'static> { .help("Verbose logging"), ) .subcommand(clap::SubCommand::with_name("post").about("Post a new notice")) - .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")) + .subcommand( + clap::SubCommand::with_name("update") + .about("Update a notice you've posted") + .arg( + Arg::with_name("id") + .help("Numeric ID of the post to update") + .value_name("ID") + .takes_value(true), + ), + ) + .subcommand( + clap::SubCommand::with_name("delete") + .about("Delete a notice you've posted") + .arg( + Arg::with_name("id") + .help("Numeric ID of the post to delete") + .value_name("ID") + .takes_value(true), + ), + ) .get_matches() } -- cgit 1.4.1-2-gfad0