Skip to content

Commit

Permalink
fix: fixes a bug where default values should have triggered a conditi…
Browse files Browse the repository at this point in the history
…onal requirement but didnt

Closes #831
  • Loading branch information
kbknapp committed Jan 31, 2017
1 parent 5ff0c36 commit 469d270
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,7 @@ impl<'a, 'b> Parser<'a, 'b>
-> ClapResult<()> {
debugln!("Parser::validate;");
let mut reqs_validated = false;
try!(self.add_defaults(matcher));
if let Some(a) = needs_val_of {
debugln!("Parser::validate: needs_val_of={:?}", a);
if let Some(o) = find_by_name!(self, &a, opts, iter) {
Expand All @@ -1024,7 +1025,6 @@ impl<'a, 'b> Parser<'a, 'b>
!reqs_validated {
try!(self.validate_required(matcher));
}
try!(self.add_defaults(matcher));
try!(self.validate_matched_args(matcher));
matcher.usage(self.create_usage(&[]));

Expand Down

0 comments on commit 469d270

Please sign in to comment.