Skip to content

Commit

Permalink
Merge pull request #4672 from epage/help
Browse files Browse the repository at this point in the history
fix(help): Respect `disable_colored_help` for `arg_required_else_help`
  • Loading branch information
epage authored Jan 24, 2023
2 parents 10a87c6 + dc89379 commit b3c4b40
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 b3c4b40

Please sign in to comment.