1
Fork 0

Rollup merge of #139799 - clubby789:print=file, r=jieyouxu

Specify `--print info=file` syntax in `--help`

Closes #139794

I moved the listing of information that can be printed to the help string as it's getting rather long and it makes the `[=FILE]` part easier to see
This commit is contained in:
Matthias Krüger 2025-04-14 21:55:39 +02:00 committed by GitHub
commit 7dc3feccdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 16 additions and 17 deletions

View file

@ -1560,9 +1560,10 @@ The default is {DEFAULT_EDITION} and the latest stable edition is {LATEST_STABLE
)
});
static PRINT_KINDS_STRING: LazyLock<String> = LazyLock::new(|| {
static PRINT_HELP: LazyLock<String> = LazyLock::new(|| {
format!(
"[{}]",
"Compiler information to print on stdout (or to a file)\n\
INFO may be one of ({}).",
PRINT_KINDS.iter().map(|(name, _)| format!("{name}")).collect::<Vec<_>>().join("|")
)
});
@ -1621,14 +1622,7 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
"Comma separated list of types of output for the compiler to emit",
"[asm|llvm-bc|llvm-ir|obj|metadata|link|dep-info|mir]",
),
opt(
Stable,
Multi,
"",
"print",
"Compiler information to print on stdout",
&PRINT_KINDS_STRING,
),
opt(Stable, Multi, "", "print", &PRINT_HELP, "INFO[=FILE]"),
opt(Stable, FlagMulti, "g", "", "Equivalent to -C debuginfo=2", ""),
opt(Stable, FlagMulti, "O", "", "Equivalent to -C opt-level=3", ""),
opt(Stable, Opt, "o", "", "Write output to <filename>", "FILENAME"),