Add -v/--version support to rust binary

This commit is contained in:
Jordi Boggiano 2013-06-28 20:34:06 +02:00 committed by Daniel Micay
parent d820355213
commit eee7accedb

View file

@ -238,6 +238,12 @@ fn usage() {
pub fn main() {
let os_args = os::args();
if (os_args.len() > 1 && (os_args[1] == ~"-v" || os_args[1] == ~"--version")) {
rustc::version(os_args[0]);
unsafe { exit(0); }
}
let args = os_args.tail();
if !args.is_empty() {