AndreasAugustin / go-gitmoji-cli

:octocat: A conventional gitmoji commit interactive command line tool for using emojis on conventional commits. :rocket:

Home Page:https://gitmoji.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: calling some cmds do not list the help when subcommands are available

AndreasAugustin opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Some subcommands have subcommands.
Currently when calling the parent subcommand one would expect to get the help with a list of available subcommands.
But you get nothing.
Example:

~  go-gitmoji-cli list -d      
INFO[0000] Debug logs enabled                           
DEBU[0000] list called                                  
☁  ~  

Expected Behavior

you should get the help command for the subcommand.

Current Behavior

you get nothing

Steps To Reproduce

~  go-gitmoji-cli list -d      
INFO[0000] Debug logs enabled                           
DEBU[0000] list called                                  
☁  ~  

Possible Solution

Remove the empty run cmd within the related subcommands

var ListCmd = &cobra.Command{
	Use:   "list",
	Short: "List all the available gitmojis",
	Long:  fmt.Sprintf(`The list is queried from the api %s.`, pkg.DefaultGitmojiApiUrl),
	Run: func(cmd *cobra.Command, args []string) {
		log.Debug("list called")
	},
}

Additional Information/Context

No response

go-gitmoji-cli Version

v0.2.6-alpha