accept single '-' as argument, such as in cat - (#153)

This commit is contained in:
Michael Tesch 2018-12-19 21:58:37 +01:00 committed by jarro2783
parent 5950d78558
commit 0edf37b6cc

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