go-flags icon indicating copy to clipboard operation
go-flags copied to clipboard

Help Displayed for func(bool) should be as for bool

Open stellarpower opened this issue 4 years ago • 0 comments

The following example:

type globalOpts struct {
	BoolFunc     func(bool)   `long:"bool-func"  description:"..."`
}

produces a help message like this:

Usage:
  example [OPTIONS]

Application Options:
      --bool-func=                 ...

In this case, I am using a callback for --bool-func for ease, however, the flag is treated (in the help at least) as if it takes a value assigned to it, rather than being a binary on/off flag, as for a plain bool option.

I think the desired output would be:

Usage:
  example [OPTIONS]

Application Options:
     --bool-func                 ...

Thanks!

stellarpower avatar Aug 14 '21 18:08 stellarpower