diff options
| author | Nathan Stocks <nathan.stocks@gmail.com> | 2017-03-30 20:49:06 -0600 |
|---|---|---|
| committer | Nathan Stocks <nathan.stocks@gmail.com> | 2017-03-30 20:49:06 -0600 |
| commit | e1b0027b51d8c8b7558513565c2baa45f1b1b984 (patch) | |
| tree | d9d89a7b1be2adbc7fb2a6313145282b3369b254 | |
| parent | 5c94997b6b1cca3e65ecfc5ba40c033d6838019b (diff) | |
| download | rust-e1b0027b51d8c8b7558513565c2baa45f1b1b984.tar.gz rust-e1b0027b51d8c8b7558513565c2baa45f1b1b984.zip | |
Refer to a subcommand as a subcommand.
For some reason 'command' and 'subcommand' were intermixed to mean the same thing. Lets just call it the one thing that it is.
| -rw-r--r-- | src/bootstrap/flags.rs | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs index b55f3d710ca..ea0fc97e22a 100644 --- a/src/bootstrap/flags.rs +++ b/src/bootstrap/flags.rs @@ -90,12 +90,11 @@ impl Flags { opts.optflag("h", "help", "print this help message"); let usage = |n, opts: &Options| -> ! { - let command = args.get(0).map(|s| &**s); - let brief = format!("Usage: x.py {} [options] [<args>...]", - command.unwrap_or("<command>")); + let subcommand = args.get(0).map(|s| &**s); + let brief = format!("Usage: x.py <subcommand> [options] [<args>...]"); println!("{}", opts.usage(&brief)); - match command { + match subcommand { Some("build") => { println!("\ Arguments: @@ -156,13 +155,13 @@ Arguments: _ => {} } - if let Some(command) = command { - if command == "build" || - command == "dist" || - command == "doc" || - command == "test" || - command == "bench" || - command == "clean" { + if let Some(subcommand) = subcommand { + if subcommand == "build" || + subcommand == "dist" || + subcommand == "doc" || + subcommand == "test" || + subcommand == "bench" || + subcommand == "clean" { println!("Available invocations:"); if args.iter().any(|a| a == "-v") { let flags = Flags::parse(&["build".to_string()]); @@ -170,10 +169,10 @@ Arguments: config.build = flags.build.clone(); let mut build = Build::new(flags, config); metadata::build(&mut build); - step::build_rules(&build).print_help(command); + step::build_rules(&build).print_help(subcommand); } else { println!(" ... elided, run `./x.py {} -h -v` to see", - command); + subcommand); } println!(""); @@ -189,13 +188,13 @@ Subcommands: clean Clean out build directories dist Build and/or install distribution artifacts -To learn more about a subcommand, run `./x.py <command> -h` +To learn more about a subcommand, run `./x.py <subcommand> -h` "); process::exit(n); }; if args.len() == 0 { - println!("a command must be passed"); + println!("a subcommand must be passed"); usage(1, &opts); } let parse = |opts: &Options| { @@ -258,7 +257,7 @@ To learn more about a subcommand, run `./x.py <command> -h` } "--help" => usage(0, &opts), cmd => { - println!("unknown command: {}", cmd); + println!("unknown subcommand: {}", cmd); usage(1, &opts); } }; |
