Allowing argument -x, -x123, but not '-x 123' #6310
Unanswered
GunterSchmidt
asked this question in
Q&A
Replies: 1 comment
-
|
The author also opened #6312 which was closed in favor of #3030. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to set up a very odd parsing requirement (mimic GNU diffutils, so no workaround):
Requirement:
-x: defaults to 5
-x123: value 123
-x 123: default to 5 (must not use argument after -x, which is required for something else)
-x=123: either 123 or error, I do not care
I seem to be in a catch 22 here:
if I set
.require_equals(true)I can do '-x', but not '-x5'.
if I set
.require_equals(false)I can do '-x5', but not '-x', as it will use the next argument as value.
Is there any way to configure my requirement?
Beta Was this translation helpful? Give feedback.
All reactions