diff --git a/src/bin/cargo/cli.rs b/src/bin/cargo/cli.rs index de1653e39ad..9cc0401a31c 100644 --- a/src/bin/cargo/cli.rs +++ b/src/bin/cargo/cli.rs @@ -682,7 +682,15 @@ See 'cargo help <>' for more information on a sp .short('Z') .value_name("FLAG") .action(ArgAction::Append) - .global(true)) + .global(true) + .add(clap_complete::ArgValueCandidates::new(|| { + let flags = CliUnstable::help(); + flags.into_iter().map(|flag| { + clap_complete::CompletionCandidate::new(flag.0.replace("_", "-")).help(flag.1.map(|help| { + help.into() + })) + }).collect() + }))) .subcommands(commands::builtin()) }