File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ pub struct ParseResult {
36
36
/// Parses command line arguments of rustpkg.
37
37
/// Returns a triplet (command, remaining_args, context)
38
38
pub fn parse_args ( args : & [ ~str ] ) -> Result < ParseResult , int > {
39
- let opts = ~[ getopts:: optflag ( "no-link" ) ,
39
+ let opts = ~[ getopts:: optflag ( "h" ) , getopts:: optflag ( "help" ) ,
40
+ getopts:: optflag ( "no-link" ) ,
40
41
getopts:: optflag ( "no-trans" ) ,
41
42
// n.b. Ignores different --pretty options for now
42
43
getopts:: optflag ( "pretty" ) ,
@@ -71,6 +72,12 @@ pub fn parse_args(args: &[~str]) -> Result<ParseResult, int> {
71
72
let pretty = matches. opt_present ( "pretty" ) ;
72
73
let emit_llvm = matches. opt_present ( "emit-llvm" ) ;
73
74
75
+ if matches. opt_present ( "h" ) ||
76
+ matches. opt_present ( "help" ) {
77
+ usage:: general ( ) ;
78
+ return Err ( 0 ) ;
79
+ }
80
+
74
81
if matches. opt_present ( "v" ) ||
75
82
matches. opt_present ( "version" ) {
76
83
version ( args[ 0 ] ) ;
You can’t perform that action at this time.
0 commit comments