Turned extra::getopts functions into methods

Some minor api and doc adjustments
This commit is contained in:
Marvin Löbel 2013-09-18 03:42:23 +02:00
parent 3c0013134c
commit 06d1dccf95
10 changed files with 668 additions and 647 deletions

View file

@ -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!(); }
}

View file

@ -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())
};
}