cxxopts: my_program -DFOO=bar fails to parse
Iām running the following program:
#include <cxxopts/cxxopts.hpp>
#include <vector>
#include <string>
int main(int argc, char** argv)
{
cxxopts::Options options { argv[0], "test program"};
options.add_options()
("D,define", "description here", cxxopts::value<std::vector<std::string>>())
;
options.parse(argc, argv);
}
and, when building with the master branch (or v3.0.0), I get this:
$ ./my_program -DA_LITTLE_EXTRA=1
terminate called after throwing an instance of 'cxxopts::option_syntax_exception'
what(): Argument ā-DA_LITTLE_EXTRA=1ā starts with a - but has incorrect syntax
Aborted
Despite the fact that, supposedly, #158 is fixed.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- Fix values attached to short options Fixes #357. — committed to jarro2783/cxxopts by jarro2783 2 years ago
- Fix values attached to short options (#360) Fixes #357. — committed to jarro2783/cxxopts by jarro2783 2 years ago
I have a fix that I will finish off in the next day.