Skip to content

Commit 1264675

Browse files
roshanavandbep
authored andcommitted
Print help message when triggered with no flags
1 parent 79639c9 commit 1264675

File tree

5 files changed

+7
-0
lines changed

5 files changed

+7
-0
lines changed

commands/convert.go

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.`
110110
cmd.PersistentFlags().StringVarP(&c.outputDir, "output", "o", "", "filesystem path to write files to")
111111
cmd.PersistentFlags().BoolVar(&c.unsafe, "unsafe", false, "enable less safe operations, please backup first")
112112

113+
cmd.RunE = nil
113114
return nil
114115
}
115116

commands/gen.go

+2
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ func (c *genCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, args [
243243
func (c *genCommand) Init(cd *simplecobra.Commandeer) error {
244244
cmd := cd.CobraCommand
245245
cmd.Short = "A collection of several useful generators."
246+
247+
cmd.RunE = nil
246248
return nil
247249
}
248250

commands/import.go

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func (c *importCommand) Init(cd *simplecobra.Commandeer) error {
9696
9797
Import requires a subcommand, e.g. ` + "`hugo import jekyll jekyll_root_path target_path`."
9898

99+
cmd.RunE = nil
99100
return nil
100101
}
101102

commands/list.go

+1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ func (c *listCommand) Init(cd *simplecobra.Commandeer) error {
182182
183183
List requires a subcommand, e.g. hugo list drafts`
184184

185+
cmd.RunE = nil
185186
return nil
186187
}
187188

commands/new.go

+2
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ You can also specify the kind with ` + "`-k KIND`" + `.
286286
If archetypes are provided in your theme or site, they will be used.
287287
288288
Ensure you run this within the root directory of your site.`
289+
290+
cmd.RunE = nil
289291
return nil
290292
}
291293

0 commit comments

Comments
 (0)