From: Bjørn Erik Pedersen Date: Sat, 27 May 2023 13:08:11 +0000 (+0200) Subject: commands: Re-introduce the -f shorthand for hugo new site X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=901cd970dbeae4b69b2dae5fc3a3482a38117258;p=brevno-suite%2Fhugo commands: Re-introduce the -f shorthand for hugo new site Fixes #11015 --- diff --git a/commands/new.go b/commands/new.go index d021be027..fc9a0bd8c 100644 --- a/commands/new.go +++ b/commands/new.go @@ -148,7 +148,7 @@ Use ` + "`hugo new [contentPath]`" + ` to create new content.`, return nil }, withc: func(cmd *cobra.Command) { - cmd.Flags().BoolVar(&force, "force", false, "init inside non-empty directory") + cmd.Flags().BoolVarP(&force, "force", "f", false, "init inside non-empty directory") }, }, &simpleCommand{ diff --git a/testscripts/commands/new.txt b/testscripts/commands/new.txt index 11fe753b9..aeebba66d 100644 --- a/testscripts/commands/new.txt +++ b/testscripts/commands/new.txt @@ -2,7 +2,7 @@ hugo new site -h stdout 'Create a new site in the provided directory' -hugo new site mysite +hugo new site mysite -f stdout 'Congratulations! Your new Hugo site is created in' cd mysite checkfile hugo.toml