mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
fix(ArgRequiredElseHelp): fixes the precedence of this error to prioritize over other error messages
Closes #895
This commit is contained in:
parent
b049cecccc
commit
74b751ff2e
1 changed files with 7 additions and 7 deletions
|
@ -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() &&
|
if matcher.is_empty() && matcher.subcommand_name().is_none() &&
|
||||||
self.0.is_set(AS::ArgRequiredElseHelp) {
|
self.0.is_set(AS::ArgRequiredElseHelp) {
|
||||||
let mut out = vec![];
|
let mut out = vec![];
|
||||||
|
@ -66,6 +59,13 @@ impl<'a, 'b, 'z> Validator<'a, 'b, 'z> {
|
||||||
info: None,
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue