Skip to content

Commit 968ce53

Browse files
committed
getopts: fixed a failing test
1 parent 2ce7019 commit 968ce53

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/libgetopts/lib.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
//!
3232
//! ~~~{.rust}
3333
//! extern mod getopts;
34-
//! use getopts::{optopt,optflag,getopts,Opt};
34+
//! use getopts::{optopt,optflag,getopts,OptGroup};
3535
//! use std::os;
3636
//!
3737
//! fn do_work(inp: &str, out: Option<~str>) {
@@ -42,7 +42,7 @@
4242
//! }
4343
//! }
4444
//!
45-
//! fn print_usage(program: &str, _opts: &[Opt]) {
45+
//! fn print_usage(program: &str, _opts: &[OptGroup]) {
4646
//! println!("Usage: {} [options]", program);
4747
//! println!("-o\t\tOutput");
4848
//! println!("-h --help\tUsage");
@@ -54,15 +54,14 @@
5454
//! let program = args[0].clone();
5555
//!
5656
//! let opts = ~[
57-
//! optopt("o"),
58-
//! optflag("h"),
59-
//! optflag("help")
57+
//! optopt("o", "", "set output file name", "NAME"),
58+
//! optflag("h", "help", "print this help menu")
6059
//! ];
6160
//! let matches = match getopts(args.tail(), opts) {
6261
//! Ok(m) => { m }
6362
//! Err(f) => { fail!(f.to_err_msg()) }
6463
//! };
65-
//! if matches.opt_present("h") || matches.opt_present("help") {
64+
//! if matches.opt_present("h") {
6665
//! print_usage(program, opts);
6766
//! return;
6867
//! }

0 commit comments

Comments
 (0)