@@ -104,17 +104,17 @@ fn run_compiler(args: &[~str]) {
104
104
driver:: compile_input ( sess, cfg, & input, & odir, & ofile) ;
105
105
}
106
106
107
- pub fn version ( argv0 : & str ) {
107
+ pub fn version ( command : & str ) {
108
108
let vers = match option_env ! ( "CFG_VERSION" ) {
109
109
Some ( vers) => vers,
110
110
None => "unknown version"
111
111
} ;
112
- println ! ( "{} {}" , argv0 , vers) ;
112
+ println ! ( "{} {}" , command , vers) ;
113
113
println ! ( "host: {}" , driver:: host_triple( ) ) ;
114
114
}
115
115
116
- fn usage ( argv0 : & str ) {
117
- let message = format ! ( "Usage: {} [OPTIONS] INPUT" , argv0 ) ;
116
+ fn usage ( ) {
117
+ let message = format ! ( "Usage: rustc [OPTIONS] INPUT" ) ;
118
118
println ! ( "{}\n \
119
119
Additional help:
120
120
-C help Print codegen options
@@ -192,9 +192,10 @@ fn describe_codegen_flags() {
192
192
/// should continue, returns a getopts::Matches object parsed from args, otherwise
193
193
/// returns None.
194
194
pub fn handle_options ( mut args : Vec < ~str > ) -> Option < getopts:: Matches > {
195
- let binary = args. shift ( ) . unwrap ( ) ;
195
+ // Throw away the first argument, the name of the binary
196
+ let _binary = args. shift ( ) . unwrap ( ) ;
196
197
197
- if args. is_empty ( ) { usage ( binary ) ; return None ; }
198
+ if args. is_empty ( ) { usage ( ) ; return None ; }
198
199
199
200
let matches =
200
201
match getopts:: getopts ( args. as_slice ( ) , config:: optgroups ( ) . as_slice ( ) ) {
@@ -205,7 +206,7 @@ pub fn handle_options(mut args: Vec<~str>) -> Option<getopts::Matches> {
205
206
} ;
206
207
207
208
if matches. opt_present ( "h" ) || matches. opt_present ( "help" ) {
208
- usage ( binary ) ;
209
+ usage ( ) ;
209
210
return None ;
210
211
}
211
212
@@ -234,7 +235,7 @@ pub fn handle_options(mut args: Vec<~str>) -> Option<getopts::Matches> {
234
235
}
235
236
236
237
if matches. opt_present ( "v" ) || matches. opt_present ( "version" ) {
237
- version ( binary ) ;
238
+ version ( "rustc" ) ;
238
239
return None ;
239
240
}
240
241
0 commit comments