diff options
| author | Georges Varouchas <[email protected]> | 2025-06-09 22:38:23 +0400 |
|---|---|---|
| committer | Georges Varouchas <[email protected]> | 2025-06-09 23:14:57 +0400 |
| commit | 4730aa0d979f34d4f7427d524b84043557ba72ef (patch) | |
| tree | 1216ad677454c2ffba6da37299a473a2296d5b98 /bool_func.go | |
| parent | f4c97c2487b06cff392d2958534e7195f79847fb (diff) | |
fix help message for Func and BoolFunc flags #430
* have '.Type()' for boolfuncValue return "boolfunc" (dedicated value,
which now makes it distinct from funcValue)
* hide extra "(default )" by stating that "" should be treated as
a zero value for a boolFlag
note:
- a boolfuncValue matches 'case boolFlag:', as it
implements the boolFlag interface,
- treating "" as a value which shouldn't trigger a "(default )"
for a regular Bool flag does not look like a breaking change
* hide extra "[=something]" for boolfuncValue
* set default placeholder name for "boolfunc" and "func" flag types
Diffstat (limited to 'bool_func.go')
| -rw-r--r-- | bool_func.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bool_func.go b/bool_func.go index 05783a9..76422bf 100644 --- a/bool_func.go +++ b/bool_func.go @@ -5,7 +5,7 @@ type boolfuncValue func(string) error func (f boolfuncValue) Set(s string) error { return f(s) } -func (f boolfuncValue) Type() string { return "func" } +func (f boolfuncValue) Type() string { return "boolfunc" } func (f boolfuncValue) String() string { return "" } // same behavior as stdlib 'flag' package |
