Skip to content

Commit 8285ab5

Browse files
committed
convert --print options to a vector
To allow manipulation of the options that appear in --print, convert it to a vector. Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
1 parent 908dba0 commit 8285ab5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/librustc/session/config.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,10 @@ mod opt {
11381138
/// including metadata for each option, such as whether the option is
11391139
/// part of the stable long-term interface for rustc.
11401140
pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
1141+
let mut print_opts = vec!["crate-name", "file-names", "sysroot", "cfg",
1142+
"target-list", "target-cpus", "target-features",
1143+
"relocation-models", "code-models"];
1144+
11411145
vec![
11421146
opt::flag_s("h", "help", "Display this message"),
11431147
opt::multi_s("", "cfg", "Configure the compilation environment", "SPEC"),
@@ -1157,9 +1161,7 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
11571161
the compiler to emit",
11581162
"[asm|llvm-bc|llvm-ir|obj|link|dep-info]"),
11591163
opt::multi_s("", "print", "Comma separated list of compiler information to \
1160-
print on stdout",
1161-
"[crate-name|file-names|sysroot|cfg|target-list|target-cpus|\
1162-
target-features|relocation-models|code-models]"),
1164+
print on stdout", &print_opts.join("|")),
11631165
opt::flagmulti_s("g", "", "Equivalent to -C debuginfo=2"),
11641166
opt::flagmulti_s("O", "", "Equivalent to -C opt-level=2"),
11651167
opt::opt_s("o", "", "Write output to <filename>", "FILENAME"),

0 commit comments

Comments
 (0)