Skip to content

Commit

Permalink
convert --print options to a vector
Browse files Browse the repository at this point in the history
To allow manipulation of the options that appear in --print, convert it
to a vector.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
  • Loading branch information
cardoe committed Dec 1, 2016
1 parent 908dba0 commit 8285ab5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/librustc/session/config.rs
Expand Up @@ -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"),
Expand All @@ -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"),
Expand Down

0 comments on commit 8285ab5

Please sign in to comment.