]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
Print help message when triggered with no flags
authorMos Roshanavand <technik@roshanavand.de>
Mon, 26 Jun 2023 18:20:24 +0000 (20:20 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 28 Jun 2023 12:58:36 +0000 (14:58 +0200)
commands/convert.go
commands/gen.go
commands/import.go
commands/list.go
commands/new.go

index f444e001c81fdd1c4ed63bb717d9ee118a1fd4b7..702c9227fafe04d945397ae0a5ff85fe0b5f8d91 100644 (file)
@@ -110,6 +110,7 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.`
        cmd.PersistentFlags().StringVarP(&c.outputDir, "output", "o", "", "filesystem path to write files to")
        cmd.PersistentFlags().BoolVar(&c.unsafe, "unsafe", false, "enable less safe operations, please backup first")
 
+       cmd.RunE = nil
        return nil
 }
 
index c5eab894af4f055deed95428282e810097bb68d1..1a3cf2174e6ac9a58a48412e8b8fa37d09ace7a2 100644 (file)
@@ -243,6 +243,8 @@ func (c *genCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, args [
 func (c *genCommand) Init(cd *simplecobra.Commandeer) error {
        cmd := cd.CobraCommand
        cmd.Short = "A collection of several useful generators."
+
+       cmd.RunE = nil
        return nil
 }
 
index 1d37c217d350d6998c8e5d84766e12bcdc2c234d..18ed7b328a463fb8acdcf85ae07f16e34bd635ea 100644 (file)
@@ -96,6 +96,7 @@ func (c *importCommand) Init(cd *simplecobra.Commandeer) error {
 
 Import requires a subcommand, e.g. ` + "`hugo import jekyll jekyll_root_path target_path`."
 
+       cmd.RunE = nil
        return nil
 }
 
index 6458df875ecdc2bc1b2375386e464212f8470ee3..6690ea9ee1aad3465438c51a7f1960de3614eff4 100644 (file)
@@ -182,6 +182,7 @@ func (c *listCommand) Init(cd *simplecobra.Commandeer) error {
 
 List requires a subcommand, e.g. hugo list drafts`
 
+       cmd.RunE = nil
        return nil
 }
 
index 633f1becb7818a369ff75a58584eb109c9788b1e..a16453d62ca8808e240328556274f4194d45e6d5 100644 (file)
@@ -286,6 +286,8 @@ You can also specify the kind with ` + "`-k KIND`" + `.
 If archetypes are provided in your theme or site, they will be used.
 
 Ensure you run this within the root directory of your site.`
+
+       cmd.RunE = nil
        return nil
 }