From 97e8db23b3e225d980100553d4616089837b2c91 Mon Sep 17 00:00:00 2001 From: Kevin K Date: Sat, 4 Mar 2017 15:14:10 -0500 Subject: [PATCH] fix: now correctly shows subcommand as required in the usage string when AppSettings::SubcommandRequiredElseHelp is used Close #883 --- src/app/parser.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/parser.rs b/src/app/parser.rs index 8e51d8bd..b0e50824 100644 --- a/src/app/parser.rs +++ b/src/app/parser.rs @@ -2139,7 +2139,8 @@ impl<'a, 'b> Parser<'a, 'b> if self.has_subcommands() && !self.is_set(AS::SubcommandRequired) { usage.push_str(" [SUBCOMMAND]"); - } else if self.is_set(AS::SubcommandRequired) && self.has_subcommands() { + } else if (self.is_set(AS::SubcommandRequired) || + self.is_set(AS::SubcommandRequiredElseHelp)) && self.has_subcommands() { usage.push_str(" "); } } else {