Go constants for libc, LSB, BSD, and systemd exit codes, based on this list compiled in the systemd docs.
go get github.com/cdzombak/exitcode_goimport (
"os"
exitcode "github.com/cdzombak/exitcode_go"
)
func main() {
if len(os.Args) < 2 {
os.Exit(exitcode.Usage)
}
os.Exit(exitcode.Success)
}generated.go is generated by cdzombak/exitcodes and should never be edited by hand. To change an exit code or add a new one, edit exitcodes.tsv in that repo; a pull request will be opened here automatically with the regenerated file.
MIT; see LICENSE.
Chris Dzombak (dzombak.com; GitHub @cdzombak).