From 9f5522668a8d573c5d5dbe6ee0584f395fba3806 Mon Sep 17 00:00:00 2001 From: Marco Molteni Date: Thu, 23 Jan 2020 16:35:45 +0100 Subject: [PATCH] address review comments --- usage.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usage.go b/usage.go index b07280b..7ee68da 100644 --- a/usage.go +++ b/usage.go @@ -89,9 +89,8 @@ func (p *Parser) writeUsageForCommand(w io.Writer, cmd *command) { } } - // if the program supports subcommands and the command-line doesn't contain any, - // give a hint to the user about the existence of these subcommands. - if len(p.cmd.subcommands) > 0 && p.cmd == cmd { + // if the program supports subcommands, give a hint to the user about their existence + if len(cmd.subcommands) > 0 { fmt.Fprint(w, " []") }