Improve help of short-only options (remove dangling comma) (#235)
This commit is contained in:
parent
794c975287
commit
9a454c8e4e
@ -1468,7 +1468,11 @@ namespace cxxopts
|
||||
|
||||
if (!s.empty())
|
||||
{
|
||||
result += "-" + toLocalString(s) + ",";
|
||||
result += "-" + toLocalString(s);
|
||||
if (!l.empty())
|
||||
{
|
||||
result += ",";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -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>>())
|
||||
|
Loading…
Reference in New Issue
Block a user