-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix @boegel's remarks ;-) #10
fix @boegel's remarks ;-) #10
Conversation
@@ -855,11 +869,15 @@ def test_option_as_value(self): | |||
self._match_testoption1_sysexit(['--store', '-b'], | |||
"Value '-b' is also a valid option") | |||
|
|||
# same for --store=-b | |||
self._match_testoption1_sysexit(['--store=-b'], |
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.
why would this fail? this has to work since it's unambigous
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.
yes, indeed, that's also why my modified stuff doesn't pass the tests, will push another commit to fix this
@stdweird: updated, please check again, I removed the bogus test and implement support to recognise |
@@ -488,7 +489,7 @@ def __init__(self, *args, **kwargs): | |||
self.environment_arguments = None | |||
self.commandline_arguments = None | |||
|
|||
def is_value_a_commandline_option(self, value, index=None): | |||
def is_value_a_commandline_option(self, opt, value, index=None): | |||
""" | |||
Determine if value is/could be an option passed via the commandline. |
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.
add something describing opt
# This is not the value you are looking for | ||
return None | ||
|
||
if not self.ALLOW_OPTION_NAME_AS_VALUE: | ||
if '-%s' % value in self._short_opt or '-%s' % value in self._long_opt: | ||
return "'-%(val)s' is a valid option, so using '%(val)s' as value is likely a typo" % {'val': value} |
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.
remove the so using '%(val)s' as value is likely a typo
it's not required (and none of the other error messages have it)
if not self.ALLOW_OPTION_NAME_AS_VALUE: | ||
if '-%s' % value in self._short_opt or '-%s' % value in self._long_opt: | ||
return "'-%(val)s' is a valid option, so using '%(val)s' as value is likely a typo" % {'val': value} | ||
|
||
# First test the exact problem where the value is an option | ||
if (not self.ALLOW_OPTION_AS_VALUE) and (value in self._long_opt or value in self._short_opt): |
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.
also here value in self._long_opt + self._short_opt
@boegel thx a lot |
for hpcugent#185