Turned extra::getopts functions into methods
Some minor api and doc adjustments
This commit is contained in:
parent
3c0013134c
commit
06d1dccf95
10 changed files with 668 additions and 647 deletions
|
|
@ -64,7 +64,7 @@ fn parse_opts(argv: ~[~str]) -> Config {
|
|||
|
||||
match getopts::getopts(opt_args, opts) {
|
||||
Ok(ref m) => {
|
||||
return Config {stress: getopts::opt_present(m, "stress")}
|
||||
return Config {stress: m.opt_present("stress")}
|
||||
}
|
||||
Err(_) => { fail!(); }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ pub fn main() {
|
|||
|
||||
match getopts(args, opts) {
|
||||
Ok(ref m) =>
|
||||
assert!(!opt_present(m, "b")),
|
||||
Err(ref f) => fail!(fail_str((*f).clone()))
|
||||
assert!(!m.opt_present("b")),
|
||||
Err(ref f) => fail!((*f).clone().to_err_msg())
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue