Skip to content

Commit

Permalink
fix(ArgRequiredElseHelp): fixes the precedence of this error to prior…
Browse files Browse the repository at this point in the history
…itize over other error messages

Closes #895
  • Loading branch information
kbknapp committed Mar 12, 2017
1 parent b049cec commit 74b751f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/app/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ impl<'a, 'b, 'z> Validator<'a, 'b, 'z> {
}
}

try!(self.validate_blacklist(matcher));
if !(self.0.is_set(AS::SubcommandsNegateReqs) && subcmd_name.is_some()) && !reqs_validated {
try!(self.validate_required(matcher));
}
try!(self.validate_matched_args(matcher));
matcher.usage(usage::create_usage_with_title(self.0, &[]));

if matcher.is_empty() && matcher.subcommand_name().is_none() &&
self.0.is_set(AS::ArgRequiredElseHelp) {
let mut out = vec![];
Expand All @@ -66,6 +59,13 @@ impl<'a, 'b, 'z> Validator<'a, 'b, 'z> {
info: None,
});
}
try!(self.validate_blacklist(matcher));
if !(self.0.is_set(AS::SubcommandsNegateReqs) && subcmd_name.is_some()) && !reqs_validated {
try!(self.validate_required(matcher));
}
try!(self.validate_matched_args(matcher));
matcher.usage(usage::create_usage_with_title(self.0, &[]));

Ok(())
}

Expand Down

0 comments on commit 74b751f

Please sign in to comment.