-
Notifications
You must be signed in to change notification settings - Fork 13
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
Simplify the help on incorrect positional arg #75
Simplify the help on incorrect positional arg #75
Conversation
Signed-off-by: Jeremy <jeremy.fowers@amd.com>
Signed-off-by: Jeremy <jeremy.fowers@amd.com>
032398d
to
8e7eb59
Compare
Signed-off-by: Jeremy <jeremy.fowers@amd.com>
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.
Looks good! Comments really helped reviewing :)
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.
Tested locally and it is looking good, although the stardard argparse exit is still hard to find when such a long help message is printed (assuming this is out of scope for now).
This is a bug fix PR.
Closes #72 by simplifying the error processing code. See #72 for an example of how thev overloaded error message would always look before.
Before: on generic errors, provide help that was relevant to both invalid command and invalid file
Now: on generic errors, let argparse decide an appropriate and specific error message for commands and files, respectively.
Demos
Invalid Command (Close to real command)
Invalid Command (Not Close)
Invalid File Input (Explicit benchmark command)
Invalid File Input (Implied benchmark command)
Same as the prior demo (as it should be)
Invalid File Extension
Before: would throw a fail whale and a stack trace.
Now: stardard argparse exit: