Skip to content

Improve invalid subcommand errors - #537

Open
AleksZyro wants to merge 1 commit into
python-poetry:mainfrom
AleksZyro:improve-invalid-subcommand-error
Open

Improve invalid subcommand errors#537
AleksZyro wants to merge 1 commit into
python-poetry:mainfrom
AleksZyro:improve-invalid-subcommand-error

Conversation

@AleksZyro

Copy link
Copy Markdown

Fixes #320.

When a command namespace is followed by an invalid subcommand, Cleo now reports the full attempted command instead of only the namespace.

For example, foo baz now reports that foo baz does not exist, rather than saying that foo does not exist.

Tested with:

python -m pytest tests/test_application.py::test_invalid_subcommand_uses_full_command_name -q
python -m pytest tests/test_application.py -q
python -m ruff check src/cleo/application.py tests/test_application.py

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misleading CLI error message: 'The command "env" does not exist.'

1 participant