diff options
Diffstat (limited to 'commands/config.go')
-rw-r--r-- | commands/config.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/commands/config.go b/commands/config.go index dfe54cba2..adf6bbe2b 100644 --- a/commands/config.go +++ b/commands/config.go @@ -28,6 +28,7 @@ import ( "github.com/gohugoio/hugo/modules" "github.com/gohugoio/hugo/parser" "github.com/gohugoio/hugo/parser/metadecoders" + "github.com/spf13/cobra" ) // newConfigCommand creates a new config command and its subcommands. @@ -112,7 +113,9 @@ func (c *configCommand) Init(cd *simplecobra.Commandeer) error { cmd.Short = "Print the site configuration" cmd.Long = `Print the site configuration, both default and custom settings.` cmd.Flags().StringVar(&c.format, "format", "toml", "preferred file format (toml, yaml or json)") + _ = cmd.RegisterFlagCompletionFunc("format", cobra.FixedCompletions([]string{"toml", "yaml", "json"}, cobra.ShellCompDirectiveNoFileComp)) cmd.Flags().StringVar(&c.lang, "lang", "", "the language to display config for. Defaults to the first language defined.") + _ = cmd.RegisterFlagCompletionFunc("lang", cobra.NoFileCompletions) applyLocalFlagsBuildConfig(cmd, c.r) return nil @@ -223,6 +226,7 @@ func (c *configMountsCommand) Init(cd *simplecobra.Commandeer) error { c.r = cd.Root.Command.(*rootCommand) cmd := cd.CobraCommand cmd.Short = "Print the configured file mounts" + cmd.ValidArgsFunction = cobra.NoFileCompletions applyLocalFlagsBuildConfig(cmd, c.r) return nil } |