File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ pub struct ParseResult {
3636/// Parses command line arguments of rustpkg.
3737/// Returns a triplet (command, remaining_args, context)
3838pub 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" ) ,
4041 getopts:: optflag ( "no-trans" ) ,
4142 // n.b. Ignores different --pretty options for now
4243 getopts:: optflag ( "pretty" ) ,
@@ -71,6 +72,12 @@ pub fn parse_args(args: &[~str]) -> Result<ParseResult, int> {
7172 let pretty = matches. opt_present ( "pretty" ) ;
7273 let emit_llvm = matches. opt_present ( "emit-llvm" ) ;
7374
75+ if matches. opt_present ( "h" ) ||
76+ matches. opt_present ( "help" ) {
77+ usage:: general ( ) ;
78+ return Err ( 0 ) ;
79+ }
80+
7481 if matches. opt_present ( "v" ) ||
7582 matches. opt_present ( "version" ) {
7683 version ( args[ 0 ] ) ;
You can’t perform that action at this time.
0 commit comments