Improve help of short-only options (remove dangling comma) (#235)

This commit is contained in:
Akos Kiss 2020-06-04 05:21:51 +02:00 committed by GitHub
parent 794c975287
commit 9a454c8e4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -1468,7 +1468,11 @@ namespace cxxopts
if (!s.empty())
{
result += "-" + toLocalString(s) + ",";
result += "-" + toLocalString(s);
if (!l.empty())
{
result += ",";
}
}
else
{

View File

@ -49,6 +49,7 @@ parse(int argc, char* argv[])
("i,input", "Input", cxxopts::value<std::string>())
("o,output", "Output file", cxxopts::value<std::string>()
->default_value("a.out")->implicit_value("b.def"), "BIN")
("x", "A short-only option", cxxopts::value<std::string>())
("positional",
"Positional arguments: these are the arguments that are entered "
"without an option", cxxopts::value<std::vector<std::string>>())