diff options
| author | Brian Anderson <[email protected]> | 2011-03-06 13:00:52 -0500 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-03-06 15:13:32 -0800 |
| commit | b893bec4bbdfda549a1c45bd5328b3dd78a2e05c (patch) | |
| tree | 15d0ee4ca0ae0f3f96f891b5f4b6fc560f42460e | |
| parent | Change io.fileflag to a tag type. Remove FIXME (diff) | |
| download | rust-b893bec4bbdfda549a1c45bd5328b3dd78a2e05c.tar.xz rust-b893bec4bbdfda549a1c45bd5328b3dd78a2e05c.zip | |
Flatten conditionals in rustc.rs. Remove FIXME
| -rw-r--r-- | src/comp/driver/rustc.rs | 27 |
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) { |