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

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

2017-07-19 Thread Rick
It's reasonable to consider calling a command with a flag that is not defined an error (whether that flag is -help or -verbose or -whatever). It is common to return non 0 on error. On Wednesday, 19 July 2017 11:31:42 UTC-7, Philippe Modard wrote: > > Hey go-nuts, > > I realize than running `mybi