Skip to content

Commit f88c749

Browse files
committed
---
yaml --- r: 151689 b: refs/heads/try2 c: fedffa7 h: refs/heads/master i: 151687: 523a836 v: v3
1 parent 05ab165 commit f88c749

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 5236af8c0ff33d60e30fdde367b476a1efa1d09e
8+
refs/heads/try2: fedffa785eb1def61d012e8e614d562afaf19a6e
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/driver/mod.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ fn run_compiler(args: &[~str]) {
104104
driver::compile_input(sess, cfg, &input, &odir, &ofile);
105105
}
106106

107-
pub fn version(argv0: &str) {
107+
pub fn version(command: &str) {
108108
let vers = match option_env!("CFG_VERSION") {
109109
Some(vers) => vers,
110110
None => "unknown version"
111111
};
112-
println!("{} {}", argv0, vers);
112+
println!("{} {}", command, vers);
113113
println!("host: {}", driver::host_triple());
114114
}
115115

116-
fn usage(argv0: &str) {
117-
let message = format!("Usage: {} [OPTIONS] INPUT", argv0);
116+
fn usage() {
117+
let message = format!("Usage: rustc [OPTIONS] INPUT");
118118
println!("{}\n\
119119
Additional help:
120120
-C help Print codegen options
@@ -192,9 +192,10 @@ fn describe_codegen_flags() {
192192
/// should continue, returns a getopts::Matches object parsed from args, otherwise
193193
/// returns None.
194194
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();
196197

197-
if args.is_empty() { usage(binary); return None; }
198+
if args.is_empty() { usage(); return None; }
198199

199200
let matches =
200201
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> {
205206
};
206207

207208
if matches.opt_present("h") || matches.opt_present("help") {
208-
usage(binary);
209+
usage();
209210
return None;
210211
}
211212

@@ -234,7 +235,7 @@ pub fn handle_options(mut args: Vec<~str>) -> Option<getopts::Matches> {
234235
}
235236

236237
if matches.opt_present("v") || matches.opt_present("version") {
237-
version(binary);
238+
version("rustc");
238239
return None;
239240
}
240241

branches/try2/src/librustdoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ pub fn main_args(args: &[StrBuf]) -> int {
153153
usage(args[0].as_slice());
154154
return 0;
155155
} else if matches.opt_present("version") {
156-
rustc::driver::version(args[0].as_slice());
156+
rustc::driver::version("rustdoc");
157157
return 0;
158158
}
159159

0 commit comments

Comments
 (0)