Closed hhromic closed 4 months ago
The stdlib flag package (specifically ExitOnError) and most command line utilities use status code 2. I tried to find proper sources for common exit status codes, however these are the best I could find:
flag
ExitOnError
2
From: https://stackoverflow.com/a/40484670
Exit status 0: success Exit status 1: "failure", as defined by the program Exit status 2: command line usage error
From: https://tldp.org/LDP/abs/html/exitcodes.html:
2 | Misuse of shell builtins (according to Bash documentation)
More importantly, currently using -1 (which translates to 255) is actually documented as a bad choice in os.Exit:
-1
os.Exit
For portability, the status code should be in the range [0, 125].
Fixes #246
The stdlib
flag
package (specificallyExitOnError
) and most command line utilities use status code2
. I tried to find proper sources for common exit status codes, however these are the best I could find:From: https://stackoverflow.com/a/40484670
From: https://tldp.org/LDP/abs/html/exitcodes.html:
More importantly, currently using
-1
(which translates to 255) is actually documented as a bad choice inos.Exit
:Fixes #246