Skip to content

Commit

Permalink
fix for counter type not rendering as INT
Browse files Browse the repository at this point in the history
  • Loading branch information
dropwhile committed Nov 12, 2023
1 parent 93d31e1 commit 7c81f9b
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 7c81f9b

Please sign in to comment.