Skip to content

Commit 2007169

Browse files
committed
Allow -g and -O options to be specified multiple times at command line.
1 parent bd4b984 commit 2007169

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/librustc/session/config.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -755,11 +755,14 @@ mod opt {
755755
pub fn multi(a: S, b: S, c: S, d: S) -> R { stable(getopts::optmulti(a, b, c, d)) }
756756
pub fn flag(a: S, b: S, c: S) -> R { stable(getopts::optflag(a, b, c)) }
757757
pub fn flagopt(a: S, b: S, c: S, d: S) -> R { stable(getopts::optflagopt(a, b, c, d)) }
758+
pub fn flagmulti(a: S, b: S, c: S) -> R { stable(getopts::optflagmulti(a, b, c)) }
759+
758760

759761
pub fn opt_u(a: S, b: S, c: S, d: S) -> R { unstable(getopts::optopt(a, b, c, d)) }
760762
pub fn multi_u(a: S, b: S, c: S, d: S) -> R { unstable(getopts::optmulti(a, b, c, d)) }
761763
pub fn flag_u(a: S, b: S, c: S) -> R { unstable(getopts::optflag(a, b, c)) }
762764
pub fn flagopt_u(a: S, b: S, c: S, d: S) -> R { unstable(getopts::optflagopt(a, b, c, d)) }
765+
pub fn flagmulti_u(a: S, b: S, c: S) -> R { unstable(getopts::optflagmulti(a, b, c)) }
763766
}
764767

765768
/// Returns the "short" subset of the rustc command line options,
@@ -786,8 +789,8 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
786789
opt::multi("", "print", "Comma separated list of compiler information to \
787790
print on stdout",
788791
"[crate-name|file-names|sysroot]"),
789-
opt::flag("g", "", "Equivalent to -C debuginfo=2"),
790-
opt::flag("O", "", "Equivalent to -C opt-level=2"),
792+
opt::flagmulti("g", "", "Equivalent to -C debuginfo=2"),
793+
opt::flagmulti("O", "", "Equivalent to -C opt-level=2"),
791794
opt::opt("o", "", "Write output to <filename>", "FILENAME"),
792795
opt::opt("", "out-dir", "Write output to compiler-chosen filename \
793796
in <dir>", "DIR"),

0 commit comments

Comments
 (0)