mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 22:50:35 +03:00
parent
018602c46d
commit
4d32f2fa89
23 changed files with 299 additions and 336 deletions
|
@ -26,17 +26,13 @@ type genautocompleteCmd struct {
|
|||
// bash for now (zsh and others will come)
|
||||
autocompleteType string
|
||||
|
||||
cmd *cobra.Command
|
||||
}
|
||||
|
||||
func (c *genautocompleteCmd) getCommand() *cobra.Command {
|
||||
return c.cmd
|
||||
*baseCmd
|
||||
}
|
||||
|
||||
func newGenautocompleteCmd() *genautocompleteCmd {
|
||||
cc := &genautocompleteCmd{}
|
||||
|
||||
cc.cmd = &cobra.Command{
|
||||
cc.baseCmd = newBaseCmd(&cobra.Command{
|
||||
Use: "autocomplete",
|
||||
Short: "Generate shell autocompletion script for Hugo",
|
||||
Long: `Generates a shell autocompletion script for Hugo.
|
||||
|
@ -72,7 +68,7 @@ or just source them in directly:
|
|||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
cc.cmd.PersistentFlags().StringVarP(&cc.autocompleteTarget, "completionfile", "", "/etc/bash_completion.d/hugo.sh", "autocompletion file")
|
||||
cc.cmd.PersistentFlags().StringVarP(&cc.autocompleteType, "type", "", "bash", "autocompletion type (currently only bash supported)")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue