Merge pull request #4032 from catamorphism/getopts
[libstd] getopts, now with fewer copies
This commit is contained in:
commit
082a88e42c
10 changed files with 68 additions and 53 deletions
15
src/test/run-pass/getopts_ref.rs
Normal file
15
src/test/run-pass/getopts_ref.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
extern mod std;
|
||||
|
||||
use std::getopts::*;
|
||||
|
||||
fn main() {
|
||||
let args = ~[];
|
||||
let opts = ~[optopt(~"b")];
|
||||
|
||||
match getopts(args, opts) {
|
||||
result::Ok(ref m) =>
|
||||
assert !opt_present(m, "b"),
|
||||
result::Err(f) => fail fail_str(f)
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue