Add negatable output when using short flag names

This commit is contained in:
Joe Schmitt
2021-03-01 16:41:31 -05:00
committed by Alec Thomas
parent ed24960916
commit d48f4e59c3
2 changed files with 13 additions and 9 deletions
+3 -3
View File
@@ -29,7 +29,7 @@ func TestHelp(t *testing.T) {
Slice []string `help:"A slice of strings." placeholder:"STR"`
Map map[string]int `help:"A map of strings to ints."`
Required bool `required help:"A required flag."`
Sort bool `negatable help:"Is sortable or not."`
Sort bool `negatable short:"s" help:"Is sortable or not."`
One struct {
Flag string `help:"Nested flag."`
@@ -76,7 +76,7 @@ Flags:
--slice=STR,... A slice of strings.
--map=KEY=VALUE;... A map of strings to ints.
--required A required flag.
--[no-]sort Is sortable or not.
-s, --[no-]sort Is sortable or not.
Commands:
one --required
@@ -117,7 +117,7 @@ Flags:
--slice=STR,... A slice of strings.
--map=KEY=VALUE;... A map of strings to ints.
--required A required flag.
--[no-]sort Is sortable or not.
-s, --[no-]sort Is sortable or not.
--flag=STRING Nested flag under two.
--required-two