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
Bug in optflagopt #104
Comments
Hi, It seems to be expected: Lines 412 to 427 in c11eb65
|
After digging a bit deeper the issue seems to be mainly to do with the parsing of an |
@ghostd Yes, I've seen that whilst I was writing a fix and I'm correcting that test which I think it is wrong in my opinion. |
When the optflagopt long version is used the parser is ignoring the argument.
Upon further attentive reading I did spot under the Parsing section of the Linux getopt user command https://man7.org/linux/man-pages/man1/getopt.1.html on the second to last paragraph the rules of engagement regarding the handling of optional arguments. I've close the associated MR for now and I'll close this afterwards if no other insightful comments materialize ... |
I've bumped into some weird behaviour in another project whereas the use of an
optflagopt
option seemed to render unexpected behaviour of the option not being properly parsed.I decided to come to the source and I extended the mod.rs test to show that something was amiss
pecastro@de5e4db
I've managed to make the test panic when you use an
optflagopt
in combination with other options.Initial investigations from debugging the test show that the vals Vec of the Matches struct will have a Vec with
Given
rather than the option value specified and that is what's causing the return of None and triggering the panic.self.vals:
The text was updated successfully, but these errors were encountered: