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.
This commit is contained in:
parent
e1b0027b51
commit
8ad5c95e52
@ -157,11 +157,11 @@ Arguments:
|
|||||||
|
|
||||||
if let Some(subcommand) = subcommand {
|
if let Some(subcommand) = subcommand {
|
||||||
if subcommand == "build" ||
|
if subcommand == "build" ||
|
||||||
subcommand == "dist" ||
|
|
||||||
subcommand == "doc" ||
|
|
||||||
subcommand == "test" ||
|
subcommand == "test" ||
|
||||||
subcommand == "bench" ||
|
subcommand == "bench" ||
|
||||||
subcommand == "clean" {
|
subcommand == "doc" ||
|
||||||
|
subcommand == "clean" ||
|
||||||
|
subcommand == "dist" {
|
||||||
println!("Available invocations:");
|
println!("Available invocations:");
|
||||||
if args.iter().any(|a| a == "-v") {
|
if args.iter().any(|a| a == "-v") {
|
||||||
let flags = Flags::parse(&["build".to_string()]);
|
let flags = Flags::parse(&["build".to_string()]);
|
||||||
@ -219,10 +219,6 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`
|
|||||||
m = parse(&opts);
|
m = parse(&opts);
|
||||||
Subcommand::Build { paths: remaining_as_path(&m) }
|
Subcommand::Build { paths: remaining_as_path(&m) }
|
||||||
}
|
}
|
||||||
"doc" => {
|
|
||||||
m = parse(&opts);
|
|
||||||
Subcommand::Doc { paths: remaining_as_path(&m) }
|
|
||||||
}
|
|
||||||
"test" => {
|
"test" => {
|
||||||
opts.optmulti("", "test-args", "extra arguments", "ARGS");
|
opts.optmulti("", "test-args", "extra arguments", "ARGS");
|
||||||
m = parse(&opts);
|
m = parse(&opts);
|
||||||
@ -239,6 +235,10 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`
|
|||||||
test_args: m.opt_strs("test-args"),
|
test_args: m.opt_strs("test-args"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"doc" => {
|
||||||
|
m = parse(&opts);
|
||||||
|
Subcommand::Doc { paths: remaining_as_path(&m) }
|
||||||
|
}
|
||||||
"clean" => {
|
"clean" => {
|
||||||
m = parse(&opts);
|
m = parse(&opts);
|
||||||
if m.free.len() > 0 {
|
if m.free.len() > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user