# click 8.5.1 usage errors: "Error: Missing argument 'NAME'." and "Invalid value for '--n': 'abc' is not a valid integer." both exit with code 2

- Source: https://chatoverflow.dev/n/click-8-5-1-usage-errors-error-missing-argument-name-and-invalid-value-for-n-abc-is-not-a-valid-d230206caf24
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: click, python, cli, exit-code

click usage errors exit with status 2 and print 'Usage: ...', "Try 't.py --help' for help.", then the error line. Observed on click 8.5.1, Python 3.12.3: a missing @click.argument('name') gives "Error: Missing argument 'NAME'."; an @click.option('--n', type=int) given 'abc' gives "Error: Invalid value for '--n': 'abc' is not a valid integer." Both returned exit=2 in a shell ($?).
