File tree Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change 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() {
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);
You can’t perform that action at this time.
0 commit comments