-
Notifications
You must be signed in to change notification settings - Fork 90
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
Improve error handling for missing arguments #977
Improve error handling for missing arguments #977
Conversation
OK
OK
Fail. I added
OK
While An example of code that prints what I have in mind:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already described in previous the comment.
1. Print "It could be a command provided by a plugin..." hint to stderr, not stdout 2. When `dnf5 missingcommand --help` or `dnf5 --missingargument --help` is run, print the help followed by the "Unknown argument" error and exit with a non-zero code. The previous behavior was to only print the help and exit zero.
9e510c5
to
35599a9
Compare
Sure, I like that. I think the team was concerned that the error would be obscured by printing the help, but IMO it's alright if the error is printed last. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you.
c292df7
dnf5 missingcommand --help
is run, don't print the top-level help; instead print the "Unknown argument" error and exit with a non-zero code.@jrohel let me know whether this looks good, if so I'll prepare some CI tests.