Skip to content

fix: preserve multichar short option in unknown-option errors#3254

Closed
klouds27 wants to merge 3 commits intopallets:mainfrom
klouds27:fix/multichar-short-option-error
Closed

fix: preserve multichar short option in unknown-option errors#3254
klouds27 wants to merge 3 commits intopallets:mainfrom
klouds27:fix/multichar-short-option-error

Conversation

@klouds27
Copy link

@klouds27 klouds27 commented Mar 8, 2026

fixes #2779

when a multichar option like -dbg is defined, passing -dbgwrong previously reported no such option: -d due to short-option fallback.

this change preserves the longest known option prefix so the error reports no such option: -dbg instead.

it also adds a regression test for this case and includes a changelog entry in CHANGES.rst.

klouds27 and others added 3 commits March 8, 2026 15:56
When a multichar option like -dbg is defined, passing -dbgwrong
previously reported 'No such option: -d' due to short-option fallback.

Preserve the longest known option prefix so the error reports
'No such option: -dbg' instead.

Adds a regression test for this case.

Closes pallets#2779

Signed-off-by: klouds27 <adalwolfad@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

1 participant