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