And make our bash completion code more compact.
// 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 = `