diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 1db7941..81ac11c 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -1723,7 +1723,7 @@ ParseResult::parse(int& argc, char**& argv) //not a flag // but if it starts with a `-`, then it's an error - if (argv[current][0] == '-') { + if (argv[current][0] == '-' && argv[current][1] != '\0') { throw option_syntax_exception(argv[current]); }