@@ -352,32 +352,32 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
352
352
353
353
// fn usage()
354
354
let usage = |exit_code: i32, opts: &Options, verbose: bool, subcommand_help: &str| -> ! {
355
- // We have an unfortunate situation here: some Steps use `builder.in_tree_crates` to determine their paths.
356
- // To determine those crates, we need to run `cargo metadata`, which means we need all submodules to be checked out.
357
- // That takes a while to run, so only do it when paths were explicitly requested, not on all CLI errors.
358
- // `Build::new` won't load submodules for the `setup` command.
359
- let cmd = if verbose {
360
- println!("note: updating submodules before printing available paths");
361
- "build"
362
- } else {
363
- "setup"
364
- };
365
- let config = Config::parse(&[cmd.to_string()]);
366
- let build = Build::new(config);
367
- let paths = Builder::get_help(&build, subcommand);
368
-
369
355
println!("{}", opts.usage(subcommand_help));
370
- if let Some(s) = paths {
371
- if verbose {
356
+ if verbose {
357
+ // We have an unfortunate situation here: some Steps use `builder.in_tree_crates` to determine their paths.
358
+ // To determine those crates, we need to run `cargo metadata`, which means we need all submodules to be checked out.
359
+ // That takes a while to run, so only do it when paths were explicitly requested, not on all CLI errors.
360
+ // `Build::new` won't load submodules for the `setup` command.
361
+ let cmd = if verbose {
362
+ println!("note: updating submodules before printing available paths");
363
+ "build"
364
+ } else {
365
+ "setup"
366
+ };
367
+ let config = Config::parse(&[cmd.to_string()]);
368
+ let build = Build::new(config);
369
+ let paths = Builder::get_help(&build, subcommand);
370
+
371
+ if let Some(s) = paths {
372
372
println!("{}", s);
373
373
} else {
374
- println!(
375
- "Run `./x.py {} -h -v` to see a list of available paths.",
376
- subcommand.as_str()
377
- );
374
+ panic!("No paths available for subcommand `{}`", subcommand.as_str());
378
375
}
379
- } else if verbose {
380
- panic!("No paths available for subcommand `{}`", subcommand.as_str());
376
+ } else {
377
+ println!(
378
+ "Run `./x.py {} -h -v` to see a list of available paths.",
379
+ subcommand.as_str()
380
+ );
381
381
}
382
382
crate::detail_exit(exit_code);
383
383
};
0 commit comments