Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(help): Respect disable_colored_help for arg_required_else_help #4672

Merged
merged 1 commit into from Jan 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/error/mod.rs
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