From: Anthony Fok Date: Mon, 10 Aug 2015 00:49:54 +0000 (-0600) Subject: Implement `hugo --theme=[Tab][Tab]` bash completion X-Git-Tag: v0.15~215 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=29c9a40a8d5defbe69c38e9997313ce27df55eaf;p=brevno-suite%2Fhugo Implement `hugo --theme=[Tab][Tab]` bash completion using the new BashCompSubdirsInDir annotation in spf13/cobra. --- diff --git a/commands/hugo.go b/commands/hugo.go index db30148d..025398f4 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -112,6 +112,7 @@ func init() { // for Bash autocomplete validConfigFilenames := []string{"json", "js", "yaml", "yml", "toml", "tml"} HugoCmd.PersistentFlags().SetAnnotation("config", cobra.BashCompFilenameExt, validConfigFilenames) + HugoCmd.PersistentFlags().SetAnnotation("theme", cobra.BashCompSubdirsInDir, []string{"themes"}) // This message will be shown to Windows users if Hugo is opened from explorer.exe cobra.MousetrapHelpText = `