You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using two libraries, one cxxopts, that both parse commandline arguments. I would appreciate it if cxxopts (which activates first) could return a filtered argc/argv pair.
Right now I do it by hand: 1. find a marker, 2. truncate argc and use that, and then 3. pass the remainder to the other library.
The text was updated successfully, but these errors were encountered:
Currently it does already stop at --, but then it treats everything else as a positional argument. So you can almost get what you want by having no positional arguments and then fetching the unmatched arguments, which returns a vector of the remaining arguments.
I have previously changed this code to specifically not modify argv at all, because it was causing a lot of people problems to have argv as non const, and they weren't expecting argv to change.
Maybe one small change that would suit your use case is to make the last matched argc accessible. Then you can just pass &argv[new_argc] to your second piece of code.
I'm using two libraries, one cxxopts, that both parse commandline arguments. I would appreciate it if cxxopts (which activates first) could return a filtered argc/argv pair.
Right now I do it by hand: 1. find a marker, 2. truncate argc and use that, and then 3. pass the remainder to the other library.
The text was updated successfully, but these errors were encountered: