namsral/flag

Execution with -h should just print the usage instruction and exit

cristim opened this issue · 2 comments

At the moment the execution continues even when executing the program with -h.

I would expect it to just print usage instructions and exit the program immediately, like the original flag package is doing.

Exit on error is the default when using the predefined flag set in both flag packages.

// CommandLine is the default set of command-line flags, parsed from os.Args.
// The top-level functions such as BoolVar, Arg, and on are wrappers for the
// methods of CommandLine.
var CommandLine = NewFlagSet(os.Args[0], ExitOnError)

See https://github.com/namsral/flag/blob/v1.7.4-pre/flag.go#L1040

No response from OP, closing issue.