mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Use spf13/pflag's new SetAnnotation helper
And make our bash completion code more compact.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
209166a261
commit
fee5519129
@@ -111,9 +111,7 @@ func init() {
|
|||||||
|
|
||||||
// for Bash autocomplete
|
// for Bash autocomplete
|
||||||
validConfigFilenames := []string{"json", "js", "yaml", "yml", "toml", "tml"}
|
validConfigFilenames := []string{"json", "js", "yaml", "yml", "toml", "tml"}
|
||||||
annotation := make(map[string][]string)
|
HugoCmd.PersistentFlags().SetAnnotation("config", cobra.BashCompFilenameExt, validConfigFilenames)
|
||||||
annotation[cobra.BashCompFilenameExt] = validConfigFilenames
|
|
||||||
HugoCmd.PersistentFlags().Lookup("config").Annotations = annotation
|
|
||||||
|
|
||||||
// This message will be shown to Windows users if Hugo is opened from explorer.exe
|
// This message will be shown to Windows users if Hugo is opened from explorer.exe
|
||||||
cobra.MousetrapHelpText = `
|
cobra.MousetrapHelpText = `
|
||||||
|
Reference in New Issue
Block a user