Merge pull request #1 from filsmick/master
The code example in README.md used `has_match`, which doesn't exist, instead of `has_arg`
This commit is contained in:
commit
29077d64d6
1 changed files with 5 additions and 4 deletions
|
@ -95,6 +95,7 @@ use std::env;
|
||||||
|
|
||||||
use pirate::Matches;
|
use pirate::Matches;
|
||||||
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let opts = &["n:", "b/boop", ":input"];
|
let opts = &["n:", "b/boop", ":input"];
|
||||||
|
|
||||||
|
@ -108,7 +109,7 @@ fn main() {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Print the program help if necessary
|
// Print the program help if necessary
|
||||||
if matches.has_match("h") || matches.has_match("help") {
|
if matches.has_arg("h") || matches.has_arg("help") {
|
||||||
help();
|
help();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -123,7 +124,7 @@ fn main() {
|
||||||
|
|
||||||
println!("{} + {} = {}", input, num, sum);
|
println!("{} + {} = {}", input, num, sum);
|
||||||
|
|
||||||
if matches.has_match("b") || matches.has_match("boop") {
|
if matches.has_arg("b") || matches.has_arg("boop") {
|
||||||
println!("Boop!!");
|
println!("Boop!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue