Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
AndreasAugustin opened this issue Aug 21, 2023 · 0 comments · Fixed by #41
Closed
1 task done
Assignees
Labels
bug Something isn't working

Comments

@AndreasAugustin
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant