]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
commands: Re-introduce the -f shorthand for hugo new site
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 27 May 2023 13:08:11 +0000 (15:08 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 27 May 2023 14:56:54 +0000 (16:56 +0200)
Fixes #11015

commands/new.go
testscripts/commands/new.txt

index d021be0274a30a59f5a92b09bb0c5e080b068e14..fc9a0bd8c165346ce95a2cafbf38dabe02eac91d 100644 (file)
@@ -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{
index 11fe753b91084833b3ad3ce9efc437c440329432..aeebba66d0c7aa0cf3f191953aa799939469d88e 100644 (file)
@@ -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