diff options
author | Ben Morrison <ben@gbmor.dev> | 2020-05-26 20:37:23 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2020-05-26 23:52:53 -0400 |
commit | cf3b6628ce4deb429fad407829b425a7377e2b5d (patch) | |
tree | e1849e20da3f80e73aad15ff195006ab0a422e8d /src/conf.rs | |
parent | 16fbf516e3b28d19570dd6e93e63b0efb9c249ff (diff) | |
download | clinte-cf3b6628ce4deb429fad407829b425a7377e2b5d.tar.gz |
hiding some log messages behind -v flag
Diffstat (limited to 'src/conf.rs')
-rw-r--r-- | src/conf.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/conf.rs b/src/conf.rs new file mode 100644 index 0000000..dd3b298 --- /dev/null +++ b/src/conf.rs @@ -0,0 +1,23 @@ +use clap::{Arg, ArgMatches}; + +lazy_static! { + pub static ref ARGS: ArgMatches<'static> = get_config(); + pub static ref DEBUG: bool = ARGS.is_present("verbose"); +} + +fn get_config() -> clap::ArgMatches<'static> { + clap::App::new("clinte") + .version(clap::crate_version!()) + .author("Ben Morrison <ben@gbmor.dev>") + .about("Command-line community notices system") + .arg( + Arg::with_name("verbose") + .short("v") + .long("verbose") + .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")) + .get_matches() +} |