Skip to content

Commit 797c866

Browse files
committed
---
yaml --- r: 6971 b: refs/heads/master c: bfc9a49 h: refs/heads/master i: 6969: 016138d 6967: 46671ab v: v3
1 parent f2411a9 commit 797c866

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 90ae3e3168a5d4afb9a81c19b8ad7cc737dac0d8
2+
refs/heads/master: bfc9a499c25919b75a87c05beb60e2c76688e7cf

trunk/src/comp/driver/rustc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ options:
6161

6262
fn main(args: [str]) {
6363
let args = args, binary = vec::shift(args);
64+
65+
if vec::len(args) == 0u { usage(binary); ret; }
66+
6467
let match =
6568
alt getopts::getopts(args, opts()) {
6669
ok(m) { m }

trunk/src/rustdoc/rustdoc.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,17 @@ fn doc_header(rd: rustdoc, name: str) {
179179
* argv[1]: crate file name",
180180
args(argv = "Command-line arguments.")
181181
)]
182+
182183
fn main(argv: [str]) {
183-
let sess = @{cm: codemap::new_codemap(), mutable next_id: 0};
184+
184185
let w = io::stdout();
186+
187+
if vec::len(argv) != 2u {
188+
w.write_str(#fmt("usage: %s <input>\n", argv[0]));
189+
ret;
190+
}
191+
192+
let sess = @{cm: codemap::new_codemap(), mutable next_id: 0};
185193
let rd = { ps: pprust::rust_printer(w), w: w };
186194
doc_header(rd, argv[1]);
187195
let p = parser::parse_crate_from_source_file(argv[1], [], sess);

0 commit comments

Comments
 (0)