chore: optionally allow parsing of hyphen-prefixied flag parameters

This allows for eg. `foo --number -10`, `foo --flag -bar`.

Fixes #478, #315.
This commit is contained in:
Alec Thomas
2025-05-15 19:31:29 +10:00
parent 8e03dbeaf6
commit 9bc3bf9925
5 changed files with 69 additions and 22 deletions
+11 -10
View File
@@ -56,16 +56,17 @@ type Kong struct {
registry *Registry
ignoreFields []*regexp.Regexp
noDefaultHelp bool
usageOnError usageOnError
help HelpPrinter
shortHelp HelpPrinter
helpFormatter HelpValueFormatter
helpOptions HelpOptions
helpFlag *Flag
groups []Group
vars Vars
flagNamer func(string) string
noDefaultHelp bool
allowHyphenated bool
usageOnError usageOnError
help HelpPrinter
shortHelp HelpPrinter
helpFormatter HelpValueFormatter
helpOptions HelpOptions
helpFlag *Flag
groups []Group
vars Vars
flagNamer func(string) string
// Set temporarily by Options. These are applied after build().
postBuildOptions []Option