about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArcterus <Arcterus@mail.com>2014-02-05 19:51:22 -0800
committerArcterus <Arcterus@mail.com>2014-02-06 10:04:26 -0800
commit968ce53dff7da4ca258c67436b81b00bd55222e6 (patch)
tree8d84b1a76935bd89013fde1b6ff88ded00a132e8
parent2ce7019b8791b11283495493e1db45735480d9b2 (diff)
downloadrust-968ce53dff7da4ca258c67436b81b00bd55222e6.tar.gz
rust-968ce53dff7da4ca258c67436b81b00bd55222e6.zip
getopts: fixed a failing test
-rw-r--r--src/libgetopts/lib.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs
index 75578caa966..e5e7c50d2ce 100644
--- a/src/libgetopts/lib.rs
+++ b/src/libgetopts/lib.rs
@@ -31,7 +31,7 @@
 //!
 //! ~~~{.rust}
 //! extern mod getopts;
-//! use getopts::{optopt,optflag,getopts,Opt};
+//! use getopts::{optopt,optflag,getopts,OptGroup};
 //! use std::os;
 //!
 //! fn do_work(inp: &str, out: Option<~str>) {
@@ -42,7 +42,7 @@
 //!     }
 //! }
 //!
-//! fn print_usage(program: &str, _opts: &[Opt]) {
+//! fn print_usage(program: &str, _opts: &[OptGroup]) {
 //!     println!("Usage: {} [options]", program);
 //!     println!("-o\t\tOutput");
 //!     println!("-h --help\tUsage");
@@ -54,15 +54,14 @@
 //!     let program = args[0].clone();
 //!
 //!     let opts = ~[
-//!         optopt("o"),
-//!         optflag("h"),
-//!         optflag("help")
+//!         optopt("o", "", "set output file name", "NAME"),
+//!         optflag("h", "help", "print this help menu")
 //!     ];
 //!     let matches = match getopts(args.tail(), opts) {
 //!         Ok(m) => { m }
 //!         Err(f) => { fail!(f.to_err_msg()) }
 //!     };
-//!     if matches.opt_present("h") || matches.opt_present("help") {
+//!     if matches.opt_present("h") {
 //!         print_usage(program, opts);
 //!         return;
 //!     }