mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-31 06:18:17 +00:00
normalize flag names so that underscores are interchangeable with hyphens
This commit is contained in:
parent
2d466f343d
commit
2ca8ae8e5f
2 changed files with 5 additions and 2 deletions
|
|
@ -402,6 +402,9 @@ func Init(root *cobra.Command) {
|
|||
root.SetHelpFunc(show_help)
|
||||
root.SetHelpCommand(&cobra.Command{Hidden: true})
|
||||
root.CompletionOptions.DisableDefaultCmd = true
|
||||
root.SetGlobalNormalizationFunc(func(fs *pflag.FlagSet, name string) pflag.NormalizedName {
|
||||
return pflag.NormalizedName(strings.ReplaceAll(name, "_", "-"))
|
||||
})
|
||||
}
|
||||
|
||||
func Execute(root *cobra.Command) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue