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