Skip to content

Commit d0b1979

Browse files
committed
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.
2 parents d1d8559 + 9e4beaa commit d0b1979

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/libextra/getopts.rs

+15-14
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,22 @@
3131
* file name following -o, and accepts both -h and --help as optional flags.
3232
*
3333
* ```
34-
* extern mod std;
35-
* use std::getopts::*;
34+
* extern mod extra;
35+
* use extra::getopts::*;
36+
* use std::os;
3637
*
3738
* fn do_work(in: &str, out: Option<~str>) {
38-
* io::println(in);
39-
* io::println(match out {
40-
* Some(x) => x,
41-
* None => ~"No Output"
42-
* });
39+
* println(in);
40+
* println(match out {
41+
* Some(x) => x,
42+
* None => ~"No Output"
43+
* });
4344
* }
4445
*
45-
* fn print_usage(program: &str, _opts: &[std::getopts::Opt]) {
46-
* io::println(fmt!("Usage: %s [options]", program));
47-
* io::println("-o\t\tOutput");
48-
* io::println("-h --help\tUsage");
46+
* fn print_usage(program: &str, _opts: &[Opt]) {
47+
* println(fmt!("Usage: %s [options]", program));
48+
* println("-o\t\tOutput");
49+
* println("-h --help\tUsage");
4950
* }
5051
*
5152
* fn main() {
@@ -58,9 +59,9 @@
5859
* optflag("h"),
5960
* optflag("help")
6061
* ];
61-
* let matches = match getopts(vec::tail(args), opts) {
62-
* result::Ok(m) => { m }
63-
* result::Err(f) => { fail!(fail_str(f)) }
62+
* let matches = match getopts(args.tail(), opts) {
63+
* Ok(m) => { m }
64+
* Err(f) => { fail!(fail_str(f)) }
6465
* };
6566
* if opt_present(&matches, "h") || opt_present(&matches, "help") {
6667
* print_usage(program, opts);

0 commit comments

Comments
 (0)