aboutsummaryrefslogtreecommitdiff
path: root/src/comp
diff options
context:
space:
mode:
authorBrian Anderson <[email protected]>2011-03-06 13:00:52 -0500
committerGraydon Hoare <[email protected]>2011-03-06 15:13:32 -0800
commitb893bec4bbdfda549a1c45bd5328b3dd78a2e05c (patch)
tree15d0ee4ca0ae0f3f96f891b5f4b6fc560f42460e /src/comp
parentChange io.fileflag to a tag type. Remove FIXME (diff)
downloadrust-b893bec4bbdfda549a1c45bd5328b3dd78a2e05c.tar.xz
rust-b893bec4bbdfda549a1c45bd5328b3dd78a2e05c.zip
Flatten conditionals in rustc.rs. Remove FIXME
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/driver/rustc.rs27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs
index 69e61aa0..67275b9b 100644
--- a/src/comp/driver/rustc.rs
+++ b/src/comp/driver/rustc.rs
@@ -113,24 +113,19 @@ impure fn main(vec[str] args) {
do_warn = false;
} else if (_str.eq(arg, "-shared")) {
shared = true;
- } else {
- // FIXME: rust could use an elif construct.
- if (_str.eq(arg, "-o")) {
- if (i+1u < len) {
- output_file = some(args.(i+1u));
- i += 1u;
- } else {
- usage(sess, args.(0));
- sess.err("-o requires an argument");
- }
+ } else if (_str.eq(arg, "-o")) {
+ if (i+1u < len) {
+ output_file = some(args.(i+1u));
+ i += 1u;
} else {
- if (_str.eq(arg, "-h")) {
- usage(sess, args.(0));
- } else {
- usage(sess, args.(0));
- sess.err("unrecognized option: " + arg);
- }
+ usage(sess, args.(0));
+ sess.err("-o requires an argument");
}
+ } else if (_str.eq(arg, "-h")) {
+ usage(sess, args.(0));
+ } else {
+ usage(sess, args.(0));
+ sess.err("unrecognized option: " + arg);
}
} else {
alt (input_file) {