From 901cd970dbeae4b69b2dae5fc3a3482a38117258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sat, 27 May 2023 15:08:11 +0200 Subject: [PATCH] commands: Re-introduce the -f shorthand for hugo new site Fixes #11015 --- commands/new.go | 2 +- testscripts/commands/new.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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