From: Stefan Sperling Subject: Re: Do not treat -h, -V as errors To: Christian Weisgerber Cc: gameoftrees@openbsd.org Date: Wed, 30 Sep 2020 23:56:02 +0200 On Wed, Sep 30, 2020 at 11:40:46PM +0200, Christian Weisgerber wrote: > Stefan Sperling: > > > On Tue, Sep 29, 2020 at 12:15:55AM +0200, Christian Weisgerber wrote: > > > do not treat the -h and -V flags as errors > > > > > > When run with the -h or -V option, output the help or version text > > > to stdout and exit with success (0). Only write usage and help > > > information to stderr and exit with error (1) if there is a mistake > > > in the command syntax. > > > > > > -------------------- > > > > > > Please check that I got all combinations right. > > > This changes the exit status code from 1 to 0 if got is run without > > a subcommand. It looks like exit status should depend on hflag here? > > Perhaps: usage(hflag, hflag ? 0 : 1); > > Right, I missed the "got with no arguments" case. Thanks! OK by me.