mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Use spf13/pflag's new SetAnnotation helper
And make our bash completion code more compact.
This commit is contained in:
parent
209166a261
commit
fee5519129
1 changed files with 1 additions and 3 deletions
|
@ -111,9 +111,7 @@ func init() {
|
|||
|
||||
// for Bash autocomplete
|
||||
validConfigFilenames := []string{"json", "js", "yaml", "yml", "toml", "tml"}
|
||||
annotation := make(map[string][]string)
|
||||
annotation[cobra.BashCompFilenameExt] = validConfigFilenames
|
||||
HugoCmd.PersistentFlags().Lookup("config").Annotations = annotation
|
||||
HugoCmd.PersistentFlags().SetAnnotation("config", cobra.BashCompFilenameExt, validConfigFilenames)
|
||||
|
||||
// This message will be shown to Windows users if Hugo is opened from explorer.exe
|
||||
cobra.MousetrapHelpText = `
|
||||
|
|
Loading…
Reference in a new issue