aboutsummaryrefslogtreecommitdiff
path: root/cli/src/lib.rs
diff options
context:
space:
mode:
authorTill Höppner2016-03-09 20:21:22 +0100
committerTill Höppner2016-03-09 20:21:22 +0100
commit1d9e3abba3ea44bc26887b059d1e4ce804b84d6f (patch)
tree2412185038179ab8e52087c9a89f1f529f180407 /cli/src/lib.rs
parent338703c0a42d0d6f191e799230d4e8d0c7514583 (diff)
downloadilc-1d9e3abba3ea44bc26887b059d1e4ce804b84d6f.tar.gz
ilc-1d9e3abba3ea44bc26887b059d1e4ce804b84d6f.tar.xz
ilc-1d9e3abba3ea44bc26887b059d1e4ce804b84d6f.zip
Include all the licenses
Diffstat (limited to 'cli/src/lib.rs')
-rw-r--r--cli/src/lib.rs16
1 files changed, 11 insertions, 5 deletions
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<String>,
+ 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);