From 1d9e3abba3ea44bc26887b059d1e4ce804b84d6f Mon Sep 17 00:00:00 2001 From: Till Höppner Date: Wed, 9 Mar 2016 20:21:22 +0100 Subject: Include all the licenses --- cli/src/lib.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'cli') diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 937ae99..8eacea4 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -36,6 +36,7 @@ mod stats; pub struct Cli { pub version: String, pub master_hash: Option, + pub notice: &'static str, } pub fn main(cli: Cli) { @@ -108,16 +109,16 @@ pub fn main(cli: Cli) { .takes_value(true) .long("output") .short("o")) + .arg(Arg::with_name("notice") + .help("Print all the notices/licenses") + .takes_value(false) + .long("notice")) .subcommand(SubCommand::with_name("parse") .about("Parse the input, checking the format")) .subcommand(SubCommand::with_name("convert") .about("Convert from a source to a target format")) .subcommand(SubCommand::with_name("stats") - .about("Analyse the activity of users by certain metrics") - /*.arg(Arg::with_name("count") - .help("The number of items to be displayed") - .takes_value(true) - .long("count"))*/) + .about("Analyse the activity of users by certain metrics")) .subcommand(SubCommand::with_name("seen") .about("Print the last line a nick was active") .arg(Arg::with_name("nick") @@ -133,6 +134,11 @@ pub fn main(cli: Cli) { in memory")) .get_matches(); + if args.is_present("notice") { + println!("{}", cli.notice); + process::exit(0) + } + let res = match args.subcommand() { ("parse", Some(args)) => { let e = Environment(&args); -- cgit v1.2.3