Skip to content

Commit

Permalink
fix(cli): Respect CARGO_TERM_COLOR in '--list' and '-Zhelp'
Browse files Browse the repository at this point in the history
Found this with the test for `-Zhelp` in rust-lang#13461.
  • Loading branch information
epage committed Feb 22, 2024
1 parent 1834244 commit 4830a4f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bin/cargo/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,18 @@ pub fn main(gctx: &mut GlobalContext) -> CliResult {
.map(String::as_str)
== Some("help")
{
config_configure(gctx, &expanded_args, None, global_args, None)?;
print_zhelp(gctx);
} else if expanded_args.flag("version") {
config_configure(gctx, &expanded_args, None, global_args, None)?;
let version = get_version_string(is_verbose);
drop_print!(gctx, "{}", version);
} else if let Some(code) = expanded_args.get_one::<String>("explain") {
config_configure(gctx, &expanded_args, None, global_args, None)?;
let mut procss = gctx.load_global_rustc(None)?.process();
procss.arg("--explain").arg(code).exec()?;
} else if expanded_args.flag("list") {
config_configure(gctx, &expanded_args, None, global_args, None)?;
print_list(gctx, is_verbose);
} else {
let (cmd, subcommand_args) = match expanded_args.subcommand() {
Expand Down

0 comments on commit 4830a4f

Please sign in to comment.