Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message in getopt.do_longs can be improved based on the existing comment #126946

Closed
bombs-kim opened this issue Nov 18, 2024 · 2 comments
Closed
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@bombs-kim
Copy link
Contributor

bombs-kim commented Nov 18, 2024

Feature or enhancement

Proposal:

getopt.do_longs raises an error when there are 2 or more possibilities for a given long option. Currently the error only shows the user input, but not the possibilities. For example, option --he not a unique prefix.

This behavior can be improved by including the possible matches in the error message, as suggested by the existing comment: “XXX since possibilities contains all valid continuations, might be nice to work them into the error msg”. For example, option --he not a unique prefix; possible options: help, hello, hearts.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

@bombs-kim bombs-kim added the type-feature A feature request or enhancement label Nov 18, 2024
@bombs-kim
Copy link
Contributor Author

bombs-kim commented Nov 18, 2024

There is already a PR related with this issue. #126871

@picnixz picnixz added the stdlib Python modules in the Lib dir label Nov 18, 2024
serhiy-storchaka pushed a commit that referenced this issue Nov 26, 2024
… comment (GH-126871)

Include a list of possibilities for not unique prefix.
@serhiy-storchaka
Copy link
Member

Thank you for your contribution @bombs-kim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants