Skip to content

Commit

Permalink
Merge f121ae7 into 1c5f4f2
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed Sep 30, 2015
2 parents 1c5f4f2 + f121ae7 commit 12c03df
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/app/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2370,8 +2370,8 @@ impl<'a, 'v, 'ab, 'u, 'h, 'ar> App<'a, 'v, 'ab, 'u, 'h, 'ar>{
// Check the possible values
if let Some(ref p_vals) = opt.possible_vals {
if !p_vals.contains(&arg_slice) {
self.possible_values_error(arg_slice, &opt.to_string(),
p_vals, matches);
return Err(self.possible_values_error(arg_slice, &opt.to_string(),
p_vals, matches));
}
}
// Check the required number of values
Expand Down Expand Up @@ -2588,9 +2588,10 @@ impl<'a, 'v, 'ab, 'u, 'h, 'ar> App<'a, 'v, 'ab, 'u, 'h, 'ar>{


if let Some(ref p_vals) = p.possible_vals {

if !p_vals.contains(&arg_slice) {
self.possible_values_error(arg_slice, &p.to_string(),
p_vals, matches);
return Err(self.possible_values_error(arg_slice, &p.to_string(),
p_vals, matches));
}
}

Expand Down Expand Up @@ -3356,7 +3357,7 @@ impl<'a, 'v, 'ab, 'u, 'h, 'ar> App<'a, 'v, 'ab, 'u, 'h, 'ar>{
-> Result<(), ClapError> {
if let Some(ref p_vals) = v.possible_vals {
if !p_vals.contains(&av) {
self.possible_values_error(av, &v.to_string(), p_vals, matches);
return Err(self.possible_values_error(av, &v.to_string(), p_vals, matches));
}
}
if !v.empty_vals && av.is_empty() && matches.args.contains_key(v.name) {
Expand Down

0 comments on commit 12c03df

Please sign in to comment.