Code example used has_match, which doesn't exist, instead of has_arg

This commit is contained in:
filsmick 2015-05-23 10:45:57 +02:00
parent 1b71c6c876
commit fb603d35ab

View file

@ -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;
} }
@ -119,11 +120,11 @@ fn main() {
None => 1 None => 1
}; };
let sum = input + num; let sum = input + num;
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!!");
} }
} }