Python constants for libc, LSB, BSD, and systemd exit codes, based on this list compiled in the systemd docs.
This package is not published to PyPI; the name exitcode there belongs to an unrelated project. Install it from this repo:
pip install git+https://github.com/cdzombak/exitcode_py@v1.0.0A wheel and sdist are also attached to each GitHub release.
import sys
import exitcode
if len(sys.argv) < 2:
sys.exit(exitcode.USAGE)
sys.exit(exitcode.SUCCESS)exitcode/__init__.py 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.
Note that pyproject.toml's version is not generated, and must be bumped to match before tagging a release; the release workflow checks this and fails if the two disagree.
MIT; see LICENSE.
Chris Dzombak (dzombak.com; GitHub @cdzombak).