mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 06:12:40 +00:00
fix(help): Respect disable_colored_help
for arg_required_else_help
Fixes #4671
This commit is contained in:
parent
10a87c662d
commit
dc89379ff6
1 changed files with 4 additions and 1 deletions
|
@ -242,7 +242,10 @@ impl<F: ErrorFormatter> Error<F> {
|
|||
/// ```
|
||||
pub fn print(&self) -> io::Result<()> {
|
||||
let style = self.formatted();
|
||||
let color_when = if self.kind() == ErrorKind::DisplayHelp {
|
||||
let color_when = if matches!(
|
||||
self.kind(),
|
||||
ErrorKind::DisplayHelp | ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand,
|
||||
) {
|
||||
self.inner.color_help_when
|
||||
} else {
|
||||
self.inner.color_when
|
||||
|
|
Loading…
Reference in a new issue