Skip to content

Commit

Permalink
Fix printing long arg in usage that expects value
Browse files Browse the repository at this point in the history
  • Loading branch information
electrikmilk committed Jun 30, 2023
1 parent 347de7b commit 6ba6477
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions args.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ func init() {
func PrintUsage() {
var availableFlags string
for a, arg := range registered {
if arg.short != "" {
availableFlags += "-" + arg.short
if arg.expectsValue {
availableFlags += "="
}
} else {
if arg.short == "" {
availableFlags += "--" + arg.name
} else {
availableFlags += "-" + arg.short
}
if arg.expectsValue {
availableFlags += "="
}
if len(registered)-1 != a {
availableFlags += " "
Expand Down

0 comments on commit 6ba6477

Please sign in to comment.