Skip to content

Commit dc89379

Browse files
committed
fix(help): Respect disable_colored_help for arg_required_else_help
Fixes #4671
1 parent 10a87c6 commit dc89379

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/error/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ impl<F: ErrorFormatter> Error<F> {
242242
/// ```
243243
pub fn print(&self) -> io::Result<()> {
244244
let style = self.formatted();
245-
let color_when = if self.kind() == ErrorKind::DisplayHelp {
245+
let color_when = if matches!(
246+
self.kind(),
247+
ErrorKind::DisplayHelp | ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand,
248+
) {
246249
self.inner.color_help_when
247250
} else {
248251
self.inner.color_when

0 commit comments

Comments
 (0)