akamensky / argparse

Argparse for golang. Just because `flag` sucks
MIT License
611 stars 62 forks source link

FlagCounter display unexpectedly #96

Closed xnslong closed 2 years ago

xnslong commented 2 years ago

Given a FlagCounter arg definition as following

verboseCounter = parser.FlagCounter("v", "verbose", &argparse.Options{
  Required: false,
  Validate: nil,
  Help:     "",
  Default:  0,
})

the help message displays it in the same style as an Int arg.

 [-v|--verbose <integer>]

however, it can not be used in the same way as an Int arg

-v 1
-v 2
-v 3

instead it should be used in the flag way.

-v
-vv
-vvv
akamensky commented 2 years ago

Looks like a bug to me.