Skip to content

Override help subcommand logic #2136

@firelizzard18

Description

@firelizzard18

I am using cobra. I don't need subcommands. I do want the default help and completion subcommands to be generated. There should be an option for "generate default subcommands even if no other subcommands are defined".

func (c *Command) InitDefaultHelpCmd() {
	if !c.HasSubCommands() {
		return
	}
	// ...
}

There should be some option that disables the subcommand check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions