Skip to content

Commit

Permalink
Do not show "available paths" help in ./x.py clean
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyip committed Sep 20, 2017
1 parent 2c78bb4 commit 09d90e5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,18 @@ Arguments:
}
});

// All subcommands can have an optional "Available paths" section
// All subcommands except `clean` can have an optional "Available paths" section
if matches.opt_present("verbose") {
let config = Config::parse(&["build".to_string()]);
let mut build = Build::new(config);
metadata::build(&mut build);

let maybe_rules_help = Builder::get_help(&build, subcommand.as_str());
extra_help.push_str(maybe_rules_help.unwrap_or_default().as_str());
} else {
extra_help.push_str(format!("Run `./x.py {} -h -v` to see a list of available paths.",
subcommand).as_str());
} else if subcommand.as_str() != "clean" {
extra_help.push_str(format!(
"Run `./x.py {} -h -v` to see a list of available paths.",
subcommand).as_str());
}

// User passed in -h/--help?
Expand Down Expand Up @@ -293,7 +294,7 @@ Arguments:
}
"clean" => {
if paths.len() > 0 {
println!("\nclean takes no arguments\n");
println!("\nclean does not take a path argument\n");
usage(1, &opts, &subcommand_help, &extra_help);
}

Expand Down

0 comments on commit 09d90e5

Please sign in to comment.