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
Before you reply to my issue #65, I have a question.
In our program, we need to parse a std::string instead of using argc, argv. The options are in this string. So to be able to use cxxopts I do a hack of the Options class and add two functions
I had to use a hack in the tests to pass in an array of character pointers for argv. Giving it a vector of strings would obviously be much simpler.
This seems pretty reasonable to do. What if you define parse(const std::vector<std::string>&) so that it constructs an array of pointers to the string.c_str() values and pass that to the actual parse?
Do you ever care about any unswallowed arguments though? You could deal with that by modifying the input vector or returning a new one.
Before you reply to my issue #65, I have a question.
In our program, we need to parse a std::string instead of using argc, argv. The options are in this string. So to be able to use cxxopts I do a hack of the Options class and add two functions
The use case is
where
line
is the string to parse and we split this line with the space delimiter and set the result in a vector of string.Did you already think about this use case ? What is the best thing to do ? Add a PR with this work ?
The text was updated successfully, but these errors were encountered: