Skip to content

Commit

Permalink
fix for counter type rendering as INT (#388)
Browse files Browse the repository at this point in the history
closes #367
  • Loading branch information
dropwhile committed Nov 13, 2023
1 parent 93d31e1 commit 2df7678
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion help.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ func formatFlag(haveShort bool, flag *Flag) string {
flagString := ""
name := flag.Name
isBool := flag.IsBool()
isCounter := flag.IsCounter()
if flag.Short != 0 {
if isBool && flag.Tag.Negatable {
flagString += fmt.Sprintf("-%c, --[no-]%s", flag.Short, name)
Expand All @@ -511,7 +512,7 @@ func formatFlag(haveShort bool, flag *Flag) string {
}
}
}
if !isBool {
if !isBool && !isCounter {
flagString += fmt.Sprintf("=%s", flag.FormatPlaceHolder())
}
return flagString
Expand Down

0 comments on commit 2df7678

Please sign in to comment.