Skip to content

-h-/--help flag is broken: ErrHelp check fails #425

Description

@aijanai

Running the example/main.go program with a -h flag yields to exit status 1, while it should actually be 0 due to the "benign" nature of the error.

Just to be clear, the following snippet:

if _, err := parser.Parse(); err != nil {
		switch flagsErr := err.(type) {
		case flags.ErrorType:
			if flagsErr == flags.ErrHelp {
				os.Exit(0)
			}
			os.Exit(1)
		default:
			os.Exit(1)
		}

should always result in a exit(0) and nothing else, when the help flag is invoked. Am I correct?

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