From 438a91dba1e3f7a9263f5408899eeeb12d8453ed Mon Sep 17 00:00:00 2001 From: Andrew Morozko Date: Sun, 20 Dec 2020 03:51:33 +0300 Subject: Skip right column if the left is empty --- usage.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'usage.go') diff --git a/usage.go b/usage.go index fc8b09a..4704183 100644 --- a/usage.go +++ b/usage.go @@ -117,6 +117,9 @@ func (p *Parser) writeUsageForCommand(w io.Writer, cmd *command) { } func printTwoCols(w io.Writer, left, help string, defaultVal string, envVal string) { + if left == "" { + return + } lhs := " " + left fmt.Fprint(w, lhs) if help != "" { -- cgit v1.2.3