Search code examples
pythonpython-click

What does it mean when Click exits with exit code 2?


I am currently testing a Click CLI application and get result.exit_code == 2. Why does that happen?


Solution

  • This appears to indicate a usage error:

    An internal exception that signals a usage error. This typically aborts any further handling.

    This is consistent with Click's own tests, e.g.