Skip to content

Commit e1b0027

Browse files
committed
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.
1 parent 5c94997 commit e1b0027

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

src/bootstrap/flags.rs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,11 @@ impl Flags {
9090
opts.optflag("h", "help", "print this help message");
9191

9292
let usage = |n, opts: &Options| -> ! {
93-
let command = args.get(0).map(|s| &**s);
94-
let brief = format!("Usage: x.py {} [options] [<args>...]",
95-
command.unwrap_or("<command>"));
93+
let subcommand = args.get(0).map(|s| &**s);
94+
let brief = format!("Usage: x.py <subcommand> [options] [<args>...]");
9695

9796
println!("{}", opts.usage(&brief));
98-
match command {
97+
match subcommand {
9998
Some("build") => {
10099
println!("\
101100
Arguments:
@@ -156,24 +155,24 @@ Arguments:
156155
_ => {}
157156
}
158157

159-
if let Some(command) = command {
160-
if command == "build" ||
161-
command == "dist" ||
162-
command == "doc" ||
163-
command == "test" ||
164-
command == "bench" ||
165-
command == "clean" {
158+
if let Some(subcommand) = subcommand {
159+
if subcommand == "build" ||
160+
subcommand == "dist" ||
161+
subcommand == "doc" ||
162+
subcommand == "test" ||
163+
subcommand == "bench" ||
164+
subcommand == "clean" {
166165
println!("Available invocations:");
167166
if args.iter().any(|a| a == "-v") {
168167
let flags = Flags::parse(&["build".to_string()]);
169168
let mut config = Config::default();
170169
config.build = flags.build.clone();
171170
let mut build = Build::new(flags, config);
172171
metadata::build(&mut build);
173-
step::build_rules(&build).print_help(command);
172+
step::build_rules(&build).print_help(subcommand);
174173
} else {
175174
println!(" ... elided, run `./x.py {} -h -v` to see",
176-
command);
175+
subcommand);
177176
}
178177

179178
println!("");
@@ -189,13 +188,13 @@ Subcommands:
189188
clean Clean out build directories
190189
dist Build and/or install distribution artifacts
191190
192-
To learn more about a subcommand, run `./x.py <command> -h`
191+
To learn more about a subcommand, run `./x.py <subcommand> -h`
193192
");
194193

195194
process::exit(n);
196195
};
197196
if args.len() == 0 {
198-
println!("a command must be passed");
197+
println!("a subcommand must be passed");
199198
usage(1, &opts);
200199
}
201200
let parse = |opts: &Options| {
@@ -258,7 +257,7 @@ To learn more about a subcommand, run `./x.py <command> -h`
258257
}
259258
"--help" => usage(0, &opts),
260259
cmd => {
261-
println!("unknown command: {}", cmd);
260+
println!("unknown subcommand: {}", cmd);
262261
usage(1, &opts);
263262
}
264263
};

0 commit comments

Comments
 (0)