Skip to content

Commit eee7acc

Browse files
Seldaekthestinger
authored andcommitted
Add -v/--version support to rust binary
1 parent d820355 commit eee7acc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librust/rust.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,12 @@ fn usage() {
238238

239239
pub fn main() {
240240
let os_args = os::args();
241+
242+
if (os_args.len() > 1 && (os_args[1] == ~"-v" || os_args[1] == ~"--version")) {
243+
rustc::version(os_args[0]);
244+
unsafe { exit(0); }
245+
}
246+
241247
let args = os_args.tail();
242248

243249
if !args.is_empty() {

0 commit comments

Comments
 (0)