Skip to content

Commit

Permalink
Fix empty summary braces
Browse files Browse the repository at this point in the history
  • Loading branch information
Makis Maropoulos committed May 28, 2016
1 parent 7047ead commit b88b74f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ GLOBAL ARGUMENTS:
{{ if .HasCommands }}
COMMANDS:
{{ range $index, $cmd := .Commands }}
{{$cmd.Name }} [{{$cmd.Flags.ToString}}] {{$cmd.Description}}
{{$cmd.Name }} {{$cmd.Flags.ToString}} {{$cmd.Description}}
{{ range $index, $subcmd := .Subcommands }}
{{$subcmd.Name}} {{$subcmd.Description}}
{{ end }}
Expand Down
4 changes: 4 additions & 0 deletions flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ func (c Flags) ToString() (summary string) {
}
}

if len(summary) > 0 {
summary = "[" + summary + "]"
}

return
}

Expand Down

0 comments on commit b88b74f

Please sign in to comment.