diff options
Diffstat (limited to 'commands/new.go')
-rw-r--r-- | commands/new.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/new.go b/commands/new.go index fc9a0bd8c..6760bf719 100644 --- a/commands/new.go +++ b/commands/new.go @@ -64,11 +64,12 @@ func newNewCommand() *newCommand { } return create.NewContent(h, contentType, args[0], force) }, - withc: func(cmd *cobra.Command) { + withc: func(cmd *cobra.Command, r *rootCommand) { cmd.Flags().StringVarP(&contentType, "kind", "k", "", "content type to create") cmd.Flags().String("editor", "", "edit new content with this editor, if provided") cmd.Flags().BoolVarP(&force, "force", "f", false, "overwrite file if it already exists") cmd.Flags().StringVar(&format, "format", "toml", "preferred file format (toml, yaml or json)") + applyLocalFlagsBuildConfig(cmd, r) }, }, @@ -147,7 +148,7 @@ Use ` + "`hugo new [contentPath]`" + ` to create new content.`, return nil }, - withc: func(cmd *cobra.Command) { + withc: func(cmd *cobra.Command, r *rootCommand) { cmd.Flags().BoolVarP(&force, "force", "f", false, "init inside non-empty directory") }, }, |