Skip to content

Commit 4830a4f

Browse files
committed
fix(cli): Respect CARGO_TERM_COLOR in '--list' and '-Zhelp'
Found this with the test for `-Zhelp` in #13461.
1 parent 1834244 commit 4830a4f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bin/cargo/cli.rs

+4
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,18 @@ pub fn main(gctx: &mut GlobalContext) -> CliResult {
5555
.map(String::as_str)
5656
== Some("help")
5757
{
58+
config_configure(gctx, &expanded_args, None, global_args, None)?;
5859
print_zhelp(gctx);
5960
} else if expanded_args.flag("version") {
61+
config_configure(gctx, &expanded_args, None, global_args, None)?;
6062
let version = get_version_string(is_verbose);
6163
drop_print!(gctx, "{}", version);
6264
} else if let Some(code) = expanded_args.get_one::<String>("explain") {
65+
config_configure(gctx, &expanded_args, None, global_args, None)?;
6366
let mut procss = gctx.load_global_rustc(None)?.process();
6467
procss.arg("--explain").arg(code).exec()?;
6568
} else if expanded_args.flag("list") {
69+
config_configure(gctx, &expanded_args, None, global_args, None)?;
6670
print_list(gctx, is_verbose);
6771
} else {
6872
let (cmd, subcommand_args) = match expanded_args.subcommand() {

0 commit comments

Comments
 (0)