File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -475,7 +475,8 @@ pub fn main() {
475
475
pub fn main_args ( args : & [ ~str ] ) {
476
476
let opts = ~[ getopts:: optflag ( "h" ) , getopts:: optflag ( "help" ) ,
477
477
getopts:: optflag ( "j" ) , getopts:: optflag ( "json" ) ,
478
- getopts:: optmulti ( "c" ) , getopts:: optmulti ( "cfg" ) ] ;
478
+ getopts:: optmulti ( "c" ) , getopts:: optmulti ( "cfg" ) ,
479
+ getopts:: optflag ( "v" ) , getopts:: optflag ( "version" ) ] ;
479
480
let matches = & match getopts:: getopts ( args, opts) {
480
481
result:: Ok ( m) => m,
481
482
result:: Err ( f) => {
@@ -488,6 +489,13 @@ pub fn main_args(args: &[~str]) {
488
489
getopts:: opt_present ( matches, "help" ) ;
489
490
let json = getopts:: opt_present ( matches, "j" ) ||
490
491
getopts:: opt_present ( matches, "json" ) ;
492
+
493
+ if getopts:: opt_present ( matches, "v" ) ||
494
+ getopts:: opt_present ( matches, "version" ) {
495
+ rustc:: version ( args[ 0 ] ) ;
496
+ return ;
497
+ }
498
+
491
499
let mut args = matches. free . clone ( ) ;
492
500
493
501
args. shift ( ) ;
You can’t perform that action at this time.
0 commit comments