Skip to content

Commit 8ad5c95

Browse files
committed
When dealing with the list of all possible subcommands, deal with them in the same order to ease comparing the sections of code in order. I chose the order that appears in the help text, because that is most likely to have been ordered with specific reasoning.
1 parent e1b0027 commit 8ad5c95

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/bootstrap/flags.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ Arguments:
157157

158158
if let Some(subcommand) = subcommand {
159159
if subcommand == "build" ||
160-
subcommand == "dist" ||
161-
subcommand == "doc" ||
162160
subcommand == "test" ||
163161
subcommand == "bench" ||
164-
subcommand == "clean" {
162+
subcommand == "doc" ||
163+
subcommand == "clean" ||
164+
subcommand == "dist" {
165165
println!("Available invocations:");
166166
if args.iter().any(|a| a == "-v") {
167167
let flags = Flags::parse(&["build".to_string()]);
@@ -219,10 +219,6 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`
219219
m = parse(&opts);
220220
Subcommand::Build { paths: remaining_as_path(&m) }
221221
}
222-
"doc" => {
223-
m = parse(&opts);
224-
Subcommand::Doc { paths: remaining_as_path(&m) }
225-
}
226222
"test" => {
227223
opts.optmulti("", "test-args", "extra arguments", "ARGS");
228224
m = parse(&opts);
@@ -239,6 +235,10 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`
239235
test_args: m.opt_strs("test-args"),
240236
}
241237
}
238+
"doc" => {
239+
m = parse(&opts);
240+
Subcommand::Doc { paths: remaining_as_path(&m) }
241+
}
242242
"clean" => {
243243
m = parse(&opts);
244244
if m.free.len() > 0 {

0 commit comments

Comments
 (0)