File tree 1 file changed +15
-14
lines changed
1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change 31
31
* file name following -o, and accepts both -h and --help as optional flags.
32
32
*
33
33
* ```
34
- * extern mod std;
35
- * use std::getopts::*;
34
+ * extern mod extra;
35
+ * use extra::getopts::*;
36
+ * use std::os;
36
37
*
37
38
* 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
+ * });
43
44
* }
44
45
*
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");
49
50
* }
50
51
*
51
52
* fn main() {
58
59
* optflag("h"),
59
60
* optflag("help")
60
61
* ];
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)) }
64
65
* };
65
66
* if opt_present(&matches, "h") || opt_present(&matches, "help") {
66
67
* print_usage(program, opts);
You can’t perform that action at this time.
0 commit comments