Skip to content

Preserve multichar option name in parser errors#3291

Closed
Ajeem-git wants to merge 1 commit into
pallets:mainfrom
Ajeem-git:issue-2779-multichar-short-option
Closed

Preserve multichar option name in parser errors#3291
Ajeem-git wants to merge 1 commit into
pallets:mainfrom
Ajeem-git:issue-2779-multichar-short-option

Conversation

@Ajeem-git
Copy link
Copy Markdown

Summary

  • preserve the longest matching multichar single-dash option when long-option matching falls through
  • avoid degrading -dbgwrong into a misleading -d parser error
  • add a regression test covering the reported behavior

Testing

  • PYTHONPATH=src ./.venv311/bin/python -m pytest -q tests/test_options.py -k "unknown_options or multichar_short_option_reports_full_option"
  • direct CliRunner repro now reports No such option: -dbg

Closes #2779

@davidism davidism closed this Mar 29, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong error message when wrong multicharacter short option is passed

2 participants