-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
'-' value argument cannot be parsed #121
Comments
Ah ok, right now |
Great to hear ! It would be great if you could publish that patch as well, so people building the tool tomorrow/early next week will have it. Thanks in advance. The question i'd have is why '-' would need to be a special case. What I would expect is that if the argument takes any bounded amount of arguments, one would just pick them off the argument sequence without interpreting them at all. The only difficulty, as always, occurs if there are one or more arguments, which is when some special handling would be in order to prevent parsing subcommands as arguments for instance. It's just what came to my mind, I have no clue after all. |
bc12e78 on master or v0.8.6 on crates.io fixes this ;) The reason it's special cased is the way it decides when to stop parsing multiple arguments, so if you had a There are other ways to solve this, which I may look at in the future. The biggest issue is you can't just store the whole "flag" as the identifier, such as |
As a side note, this issue also helped something I'd totally forgotten about. |
Yes, I see, there is more about argument parsing :) ! Totally forgot about the short flag concatenation. Besides: You are welcome, it's always a pleasure to interact with this project ! |
In an argument like the following:
It seems impossible to provide a value that is or starts with a
-
. The latter is common to specify that input should be read from stdin, instead of from a file.The actual output in my current (toy) program is:
The text was updated successfully, but these errors were encountered: