about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-06-11 10:46:37 -0700
committerbors <bors@rust-lang.org>2013-06-11 10:46:37 -0700
commitd0b197900485c98cf2a09298823ea274db50c4d9 (patch)
tree3265dcb5497fafc4a8151c7fd5437d43deba0330
parentd1d855993d0386fc13ad1b74df565b5ba6f6e4ea (diff)
parent9e4beaac9d6de2e867427f06e8420b8bac847181 (diff)
downloadrust-d0b197900485c98cf2a09298823ea274db50c4d9.tar.gz
rust-d0b197900485c98cf2a09298823ea274db50c4d9.zip
auto merge of #7035 : influenza/rust/getopts-doc-update, r=bstrie
The documentation was still refering to getopts as though it was in the
std module - I've changed this to refer to extra instead.
-rw-r--r--src/libextra/getopts.rs29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/libextra/getopts.rs b/src/libextra/getopts.rs
index 44b56590083..8d58bd18859 100644
--- a/src/libextra/getopts.rs
+++ b/src/libextra/getopts.rs
@@ -31,21 +31,22 @@
  * file name following -o, and accepts both -h and --help as optional flags.
  *
  * ```
- *    extern mod std;
- *    use std::getopts::*;
+ *    extern mod extra;
+ *    use extra::getopts::*;
+ *    use std::os;
  *
  *    fn do_work(in: &str, out: Option<~str>) {
- *      io::println(in);
- *      io::println(match out {
- *        Some(x) => x,
- *        None => ~"No Output"
- *      });
+ *        println(in);
+ *        println(match out {
+ *            Some(x) => x,
+ *            None => ~"No Output"
+ *        });
  *    }
  *
- *    fn print_usage(program: &str, _opts: &[std::getopts::Opt]) {
- *      io::println(fmt!("Usage: %s [options]", program));
- *      io::println("-o\t\tOutput");
- *      io::println("-h --help\tUsage");
+ *    fn print_usage(program: &str, _opts: &[Opt]) {
+ *        println(fmt!("Usage: %s [options]", program));
+ *        println("-o\t\tOutput");
+ *        println("-h --help\tUsage");
  *    }
  *
  *    fn main() {
@@ -58,9 +59,9 @@
  *            optflag("h"),
  *            optflag("help")
  *        ];
- *        let matches = match getopts(vec::tail(args), opts) {
- *            result::Ok(m) => { m }
- *            result::Err(f) => { fail!(fail_str(f)) }
+ *        let matches = match getopts(args.tail(), opts) {
+ *            Ok(m) => { m }
+ *            Err(f) => { fail!(fail_str(f)) }
  *        };
  *        if opt_present(&matches, "h") || opt_present(&matches, "help") {
  *            print_usage(program, opts);