Code example used has_match
, which doesn't exist, instead of has_arg
This commit is contained in:
parent
1b71c6c876
commit
fb603d35ab
1 changed files with 5 additions and 4 deletions
|
@ -95,6 +95,7 @@ use std::env;
|
|||
|
||||
use pirate::Matches;
|
||||
|
||||
|
||||
fn main() {
|
||||
let opts = &["n:", "b/boop", ":input"];
|
||||
|
||||
|
@ -108,7 +109,7 @@ fn main() {
|
|||
};
|
||||
|
||||
// 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();
|
||||
return;
|
||||
}
|
||||
|
@ -123,7 +124,7 @@ fn main() {
|
|||
|
||||
println!("{} + {} = {}", input, num, sum);
|
||||
|
||||
if matches.has_match("b") || matches.has_match("boop") {
|
||||
if matches.has_arg("b") || matches.has_arg("boop") {
|
||||
println!("Boop!!");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue