Skip to content

Wrong error message when wrong multicharacter short option is passedΒ #2779

Closed

Description

@ocervell

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.

Activity

  1. 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
  2. Rowlando13 commented on Apr 6, 2025

    @Rowlando13
    Member

    @davidism I have only seen single character short options. Do we intentionally support multi character short options?

  3. ocervell commented on Dec 18, 2025

    @ocervell
    Author

    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.

  4. davidism commented on Dec 18, 2025

    @davidism
    Member

    This is the correct error message. Short options can be stacked, -dbg is equivalent to -d -b -g, so the first unregistered option raises an error.

  5. Rowlando13 commented on Dec 19, 2025

    @Rowlando13
    Member

    Just reopening for docs addition.

  6. added
    docsUpdates to documentation, readme, docstrings, typos
    on Dec 19, 2025
  7. Rowlando13 commented on Dec 25, 2025

    @Rowlando13
    Member

    Add docs section in options section with:

    • Title: combining short options
    • the short option combining behavior explanation and example
    • note about multi character short options not being supported
  8. LouisLau-art commented on Feb 5, 2026

    @LouisLau-art

    I opened a PR adding the requested docs section about stacking short options and clarifying that multi-character short options aren’t supported: #3200

  9. Rowlando13 commented on Feb 7, 2026

    @Rowlando13
    Member

    @LouisLau-art Please read the activity before opening a PR. #3179 was already submitted.

  10. LouisLau-art commented on Feb 13, 2026

    @LouisLau-art

    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.

  11. added a commit that references this issue on Feb 13, 2026
    b09dbe7
  12. deleted a comment from Ajeem-git on Mar 29, 2026
  13. kdeldycke commented on Apr 15, 2026

    @kdeldycke
    Collaborator

    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.

  14. added this to the 8.3.3 milestone on Apr 15, 2026
  15. removed this from the 8.3.3 milestone on Apr 16, 2026
  16. added this to the 8.4.0 milestone on Apr 16, 2026
  17. kdeldycke commented on Apr 21, 2026

    @kdeldycke
    Collaborator

    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

  18. deleted a comment from algojogacor on May 12, 2026
  19. Rowlando13 commented on May 13, 2026

    @Rowlando13
    Member

    @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.

  20. kdeldycke commented on May 15, 2026

    @kdeldycke
    Collaborator

    @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?

  21. added a commit that references this issue on May 15, 2026
    bd3b2d6
  22. locked as resolved and limited conversation to collaborators on Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsUpdates to documentation, readme, docstrings, typos

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions