diff options
author | Mos Roshanavand <[email protected]> | 2023-06-26 20:20:24 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-06-28 14:58:36 +0200 |
commit | 12646750aa186cf3bf50266f8eddf9cfebc3c9c9 (patch) | |
tree | 49a06fff124ec0b8559980378b43d990aa2e3d92 | |
parent | 79639c981cf69193fb21d97773d928c089714750 (diff) | |
download | hugo-12646750aa186cf3bf50266f8eddf9cfebc3c9c9.tar.gz hugo-12646750aa186cf3bf50266f8eddf9cfebc3c9c9.zip |
Print help message when triggered with no flags
-rw-r--r-- | commands/convert.go | 1 | ||||
-rw-r--r-- | commands/gen.go | 2 | ||||
-rw-r--r-- | commands/import.go | 1 | ||||
-rw-r--r-- | commands/list.go | 1 | ||||
-rw-r--r-- | commands/new.go | 2 |
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 } |