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

Hint when an unknown option is available on different commands #1858

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

kontura
Copy link
Contributor

@kontura kontura commented Nov 13, 2024

@jrohel
Copy link
Contributor

jrohel commented Nov 19, 2024

Thank you. This hint may help users.

Note:
There is a problem with a group of several short arguments. For example:

# dnf -yl upgrade
Unknown argument "-yl" for command "dnf5". Add "--help" for more information about the arguments. 
The argument is available for commands: . (It has to be placed after the command.)

Instead of being told that the second argument 'l' is unknown (or in this case, that it is available for repoquery), the user is told the information for the first argument 'y', which is available globally (an empty command is displayed).
But even so, this PR gives a helpful hint in other situations. To solve the above problem, it would want to extend the information provided by the argument parser.

I'll merge it.

@jrohel jrohel added this pull request to the merge queue Nov 19, 2024
Merged via the queue into rpm-software-management:main with commit 53cdd9c Nov 19, 2024
20 checks passed
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.

Add a hint when unknown global option matches known command option
2 participants