cxxopts icon indicating copy to clipboard operation
cxxopts copied to clipboard

allow_unrecognized_options "eats up" the unrecognized options

Open eyalroz opened this issue 4 years ago • 7 comments

Suppose I've set allow_unrecognized_options(). I understand that I don't get those back as some map of option-name-to-value (as discussed in #239). But - why are these options removed from the command-line? If the command-line is touched at all, only the options that get parsed should be removed from it.

eyalroz avatar Jul 21 '20 08:07 eyalroz

That sounds like a bug. I'll check that out.

jarro2783 avatar Jul 21 '20 10:07 jarro2783

By "removed from the command line" I mean that argv is moved past them.

eyalroz avatar Jul 21 '20 11:07 eyalroz

That sounds like a bug. I'll check that out.

Have you had a look at this?

eyalroz avatar May 01 '22 11:05 eyalroz

Sorry I don't remember. I will try to do that soon. I think by the date this was for v2. If it's fixed in v3 is that good enough for you, or would you want a fix to the v2 branch?

jarro2783 avatar May 02 '22 02:05 jarro2783

@jarro2783 : For me, v3 is fine. But I'm just one person, and maybe others would be interested in a back-port. It is, after all, a bug fix (and I'm guessing it should be a lot of code).

Also - I don't know what the significant differences are between v2.x and v3.0, since the release page doesn't really explain, and you don't have a "roadmap" or "history" page.

eyalroz avatar May 02 '22 09:05 eyalroz

This works correctly now, and there is a note at the top of the README about unmatched arguments. I have just added it to the example file as well.

I checked out the latest v2 code, and it does seem like unrecognised arguments are still left in argv.

jarro2783 avatar May 02 '22 20:05 jarro2783

So, close this?

eyalroz avatar Jul 06 '22 20:07 eyalroz