Skip to content

[feature request] Optional help commands #612

Description

@maratori

It's very handy when a CLI prints help not only with --help flag, but also with help command. Let's add an option WithHelpCommands() which makes the following runs behaving the same:

my-bin foo bar --help
my-bin foo bar -h
my-bin foo bar help
my-bin --help foo bar
my-bin -h foo bar
my-bin help foo bar

Now, users have to manipulate args to achieve the desired:

for i, arg := range os.Args[1:] {
	if arg == "help" {
		os.Args[1+i] = "--help"
	}
}

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