summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMos Roshanavand <technik@roshanavand.de>2023-06-26 20:20:24 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-06-28 14:58:36 +0200
commit12646750aa186cf3bf50266f8eddf9cfebc3c9c9 (patch)
tree49a06fff124ec0b8559980378b43d990aa2e3d92
parent79639c981cf69193fb21d97773d928c089714750 (diff)
Print help message when triggered with no flags
-rw-r--r--commands/convert.go1
-rw-r--r--commands/gen.go2
-rw-r--r--commands/import.go1
-rw-r--r--commands/list.go1
-rw-r--r--commands/new.go2
5 files changed, 7 insertions, 0 deletions
diff --git a/commands/convert.go b/commands/convert.go
index f444e001c..702c9227f 100644
--- a/commands/convert.go
+++ b/commands/convert.go
@@ -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
}
diff --git a/commands/gen.go b/commands/gen.go
index c5eab894a..1a3cf2174 100644
--- a/commands/gen.go
+++ b/commands/gen.go
@@ -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
}
diff --git a/commands/import.go b/commands/import.go
index 1d37c217d..18ed7b328 100644
--- a/commands/import.go
+++ b/commands/import.go
@@ -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
}
diff --git a/commands/list.go b/commands/list.go
index 6458df875..6690ea9ee 100644
--- a/commands/list.go
+++ b/commands/list.go
@@ -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
}
diff --git a/commands/new.go b/commands/new.go
index 633f1becb..a16453d62 100644
--- a/commands/new.go
+++ b/commands/new.go
@@ -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
}