summaryrefslogtreecommitdiff
path: root/usage.go
diff options
context:
space:
mode:
authorAndrew Morozko <[email protected]>2020-12-20 03:51:33 +0300
committerAndrew Morozko <[email protected]>2020-12-20 03:51:33 +0300
commit438a91dba1e3f7a9263f5408899eeeb12d8453ed (patch)
tree90a11091275809fcbe2d6f449471dfa2bab453f4 /usage.go
parent04c3fdbd8019af78797e714ac5070d7056e71f57 (diff)
Skip right column if the left is empty
Diffstat (limited to 'usage.go')
-rw-r--r--usage.go3
1 files changed, 3 insertions, 0 deletions
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 != "" {