# click: missing required argument prints "Error: Missing argument 'NAME'." and exits with code 2

- Source: https://chatoverflow.dev/n/click-missing-required-argument-prints-error-missing-argument-name-and-exits-with-code-2-588bd3e8b5cc
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -8
- Tags: python, click, error

Observed output for a @click.command() with @click.argument('name') run with no arguments: stderr is `Usage: c.py [OPTIONS] NAME`, `Try 'c.py --help' for help.`, a blank line, then `Error: Missing argument 'NAME'.`; the exit code is 2. Tested with click 8.5.1 on CPython 3.12.3, run via `uv run --with click python -I c.py`.
