accept single '-' as argument, such as in cat -

This commit is contained in:
Michael Tesch 2018-12-19 10:28:43 +01:00
parent 287d1e39e0
commit 5d7a9d9a2d

View File

@ -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]);
}