You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong error message when wrong multicharacter short option is passedΒ #2779
Sometime it is usefull to have not only single char short option like -d but something like -dbg.
They are already working as-is (even though not documented), but when passing a wrong option such as -dbgwrong, the error displays: No such option: -d instead of No such option: -dbg.
changed the title [-]Wrong error message when wrong multicharacter short option is passed.[/-][+]Wrong error message when wrong multicharacter short option is passed[/+]on Sep 24, 2024
I opened a PR adding the requested docs section about stacking short options and clarifying that multi-character short options arenβt supported: #3200
If this issue is about documentation, I still think the origin lies in a surprising error message. So in the mean time, I experimented with Click UI and tried to make the error message in this case verbosier. It is integrated with Click Extra >= 7.12.0 so you can use Click Extra if you want to get this feature. See the code at: kdeldycke/click-extra@344a907
@kdeldycke Its definitely a both and scenario. We don't actually say anywhere in our docs that short option compacting works by default. So we will need to add that. A better error message really puts a bow on it.
@kdeldycke Its definitely a both and scenario. We don't actually say anywhere in our docs that short option compacting works by default. So we will need to add that. A better error message really puts a bow on it.
I added some docs about this behavior at: #3431 . Is that enough to close that issue in your opinion?
Activity
[-]Wrong error message when wrong multicharacter short option is passed.[/-][+]Wrong error message when wrong multicharacter short option is passed[/+]Rowlando13 commentedon Apr 6, 2025
@davidism I have only seen single character short options. Do we intentionally support multi character short options?
ocervell commentedon Dec 18, 2025
Hi @davidism,
any updates here ? It seems we do accept multi-char short options, so we should have the proper error message when they are not found.
davidism commentedon Dec 18, 2025
This is the correct error message. Short options can be stacked,
-dbgis equivalent to-d -b -g, so the first unregistered option raises an error.Rowlando13 commentedon Dec 19, 2025
Just reopening for docs addition.
Rowlando13 commentedon Dec 25, 2025
Add docs section in options section with:
LouisLau-art commentedon Feb 5, 2026
I opened a PR adding the requested docs section about stacking short options and clarifying that multi-character short options arenβt supported: #3200
Rowlando13 commentedon Feb 7, 2026
@LouisLau-art Please read the activity before opening a PR. #3179 was already submitted.
LouisLau-art commentedon Feb 13, 2026
Sorry about the duplicate PR noise β I missed that #3179 was already submitted. Iβve closed #3200 to avoid duplication. Thanks for the heads-up.
fix: show full option name in error for invalid multi-char short options
kdeldycke commentedon Apr 15, 2026
So, to reframe the discussion: the root cause is a documentation issue, there is no approval by the maintainers to change the parser.
This will be closed by #3179, or we can even re-open #3200 by @LouisLau-art if the author of #3179 (@aadelb) is unresponsive to feedbacks.
Improve error messages for single-dash multi-character tokens
kdeldycke commentedon Apr 21, 2026
If this issue is about documentation, I still think the origin lies in a surprising error message. So in the mean time, I experimented with Click UI and tried to make the error message in this case verbosier. It is integrated with Click Extra >= 7.12.0 so you can use Click Extra if you want to get this feature. See the code at: kdeldycke/click-extra@344a907
Rowlando13 commentedon May 13, 2026
@kdeldycke Its definitely a both and scenario. We don't actually say anywhere in our docs that short option compacting works by default. So we will need to add that. A better error message really puts a bow on it.
kdeldycke commentedon May 15, 2026
I added some docs about this behavior at: #3431 . Is that enough to close that issue in your opinion?
Document short option stacking behavior