Skip to content

Commit

Permalink
show options for -W help and -W
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenny222 committed May 24, 2013
1 parent 7c0cc9c commit 1009c21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/librustc/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
for detail)", "FEATURE"),
optopt("", "android-cross-path",
"The path to the Android NDK", "PATH"),
optmulti("W", "warn",
optflagopt("W", "warn",
"Set lint warnings", "OPT"),
optmulti("A", "allow",
"Set lint allowed", "OPT"),
Expand Down
7 changes: 6 additions & 1 deletion src/librustc/rustc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,14 @@ pub fn run_compiler(args: &~[~str], demitter: diagnostic::Emitter) {
return;
}

// Display the available lint options if "-W help" or only "-W" is given.
let lint_flags = vec::append(getopts::opt_strs(matches, "W"),
getopts::opt_strs(matches, "warn"));
if lint_flags.contains(&~"help") {

let show_lint_options = lint_flags.contains(&~"help") ||
(opt_present(matches, "W") && lint_flags.is_empty());

if show_lint_options {
describe_warnings();
return;
}
Expand Down

5 comments on commit 1009c21

@bors
Copy link
Contributor

@bors bors commented on 1009c21 May 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 1009c21 May 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging kud1ing/rust/rustc_w = 1009c21 into auto

@bors
Copy link
Contributor

@bors bors commented on 1009c21 May 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kud1ing/rust/rustc_w = 1009c21 merged ok, testing candidate = fa67e09

@bors
Copy link
Contributor

@bors bors commented on 1009c21 May 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 1009c21 May 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = fa67e09

Please sign in to comment.