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>
This commit is contained in:
Doug Goldstein 2016-12-01 16:26:47 -06:00
parent 908dba0c94
commit 8285ab5c99
No known key found for this signature in database
GPG key ID: A2BC03DC87ED1BD4

View file

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