Re: [go-nuts] Re: default --help flag behavior

2017-07-26 Thread Konstantin Khomoutov
On Thu, Jul 20, 2017 at 07:23:23AM +1000, Rob Pike wrote: >>> I realize than running `mybinary --help` returns a nice help message >>> along with a exit status 2. >>> What is the reason it doesn't return 0? [...] >> It's reasonable to consider calling a command with a flag that is not >> defined a

Re: [go-nuts] Re: default --help flag behavior

2017-07-19 Thread Rob Pike
The Unix tradition, fading away like all the other Unix traditions, is that exit code 0 is for success, 1 is for failed execution, and 2 is for reporting that the usage was incorrect, preventing it from running. Although one could make the case that "-help" did what it was supposed to do, tradition