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
1 changed files with 5 additions and 3 deletions

View File

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