-
Notifications
You must be signed in to change notification settings - Fork 212
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
Using -testid yields misleading error message #428
Comments
This appears to be an issue with using a single dash. When I use a "-compare cam5_4_80" I get basically |
I tested this command again and still get the still "unhelpful" error message |
@cacraigucar single-dash long-options (-long) are not POSIX compliant and create_test doesn't support them. Use (-s) for short option and (--long) for long options. |
But shouldn't "-testid" result in a message like "invalid option"? Some hint that they're not using POSIX compliant arguments. |
This is handled by the python argparse module. |
The problem is that we are moving from using single dashes with CESM1 to double dashes in CESM2. That combined with the likelihood of a simple typo, it would be good if an error like this could be trapped (in my cases it was a typo that I didn't realize I'd made). I was requesting a simple error message that doesn't say something about grid information which sends the user in a completely wrong direction trying to solve their problem. |
What is handled by argparse? A good error message? Apparently not. |
I have a method to address this but need to think a bit about where to put it - basically it needs to happen in each interface prior to calling parser.parse_args
|
Actually
is sufficient |
How's this?
|
Perfect - just what I was hoping for! |
How about:
|
I have a branch where I have implemented this change, however there is a problem and I think that we need to discuss whether we want this on before cesm2 - namely there is still code internal to cime as well as in the component models which use the single dash long form and so this change will require changes to all of the component models. I think if we are going to apply this change we need to apply it uniformly and not on an option by option basis. Branch is test_cli on my fork - how shall we proceed? |
If there is code in component models that just use a single dash - I think
its too late to try to change this across the entire system before the
release. There are already enough issues we need to resolve in the next few
weeks before the freeze without trying to make this consistent across the
system as well.
…On Wed, Apr 19, 2017 at 4:45 PM, jedwards4b ***@***.***> wrote:
I have a branch where I have implemented this change, however there is a
problem and I think that we need to discuss whether we want this on before
cesm2 - namely there is still code internal to cime as well as in the
component models which use the single dash long form and so this change
will require changes to all of the component models. I think if we are
going to apply this change we need to apply it uniformly and not on an
option by option basis. Branch is test_cli on my fork - how shall we
proceed?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#428 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHlxExfwd-vX4jLteE7TdrxfczroECpVks5rxnJygaJpZM4JoASB>
.
|
But I think that Cheryl is right - the current error message is confusing. I would like to continue to track the trunk with this branch and consider merging it as part of our beta07 tag. |
Agreed.
…On Thu, Apr 20, 2017 at 9:34 AM, jedwards4b ***@***.***> wrote:
But I think that Cheryl is right - the current error message is confusing.
I would like to continue to track the trunk with this branch and consider
merging it as part of our beta07 tag.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#428 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHlxE8uh4y-RgBGrVGerB7GD5Z8BjaY4ks5rx179gaJpZM4JoASB>
.
|
Also the python create_test, the subject of this issue, has always been strict about single dash I think. So it won't break anything to have a better error message/better enforcement in create_test. |
@jedwards4b @rljacob @mvertens I feel strongly that we should not be trying to anticipate every way the user may mess-up their command-line arguments. Most of the time, argparse will provide a decent error. In this case, we got unlucky and the error wasn't very good. What happened is this:
... this gets interpreted as
so that cam5_4_80 is being interpreted as a test name. One thing we could do is to improve the error when an invalid test name is provided. Since our other tools support non-compliant POSIX long options, maybe we should just do the same in create_test so we're at least consistent. |
In this particular case (moving from using single dash to double dash for this release), I suspect that this will be a mistake that will be made more often. It is hard to retrain fingers (at least I had that problem two days in a row!) When I encountered this error message the first time, I spent a lot of time digging into the config_compset file where my grid is defined, trying to figure out what I did wrong there. It was only when I typed the command from scratch (without the typo) that I was able to figure out what I did wrong. |
Conforming command line All command line arguments should conform. I have allowed for one exception, the -value option to xmlquery. Test suite: scripts_regression_tests.py Test baseline: Test namelist changes: Test status: bit for bit Fixes #428 User interface changes?: YES, now accepting only conforming command line arguments Code review:
The command:
./create_test --xml-machine yellowstone --xml-compiler intel --xml-category aux_cam -testid aux_cam_try8
gives the error message:
ERROR: Could not fill-out test name, partial string 'aux_cam_try8' had no grid information and you did not provide any
The text was updated successfully, but these errors were encountered: