Skip to content

Commit

Permalink
fix(help): Respect disable_colored_help for arg_required_else_help
Browse files Browse the repository at this point in the history
Fixes #4671
  • Loading branch information
epage committed Jan 24, 2023
1 parent 10a87c6 commit dc89379
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dc89379

Please sign in to comment.