From: Anthony Fok Date: Sat, 8 Aug 2015 04:50:36 +0000 (-0600) Subject: Use spf13/pflag's new SetAnnotation helper X-Git-Tag: v0.15~218 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fee5519129948d29584341f865e9e8cbe5668b83;p=brevno-suite%2Fhugo Use spf13/pflag's new SetAnnotation helper And make our bash completion code more compact. --- diff --git a/commands/hugo.go b/commands/hugo.go index e1a75a09..db30148d 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -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 = `