From 5d7a9d9a2d9a3512dfc35dbcca3f14a8650349f5 Mon Sep 17 00:00:00 2001 From: Michael Tesch Date: Wed, 19 Dec 2018 10:28:43 +0100 Subject: [PATCH] accept single '-' as argument, such as in `cat -` --- include/cxxopts.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 6677002..aaa3d7d 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]); }