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())
|
if (!s.empty())
|
||||||
{
|
{
|
||||||
result += "-" + toLocalString(s) + ",";
|
result += "-" + toLocalString(s);
|
||||||
|
if (!l.empty())
|
||||||
|
{
|
||||||
|
result += ",";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -49,6 +49,7 @@ parse(int argc, char* argv[])
|
|||||||
("i,input", "Input", cxxopts::value<std::string>())
|
("i,input", "Input", cxxopts::value<std::string>())
|
||||||
("o,output", "Output file", cxxopts::value<std::string>()
|
("o,output", "Output file", cxxopts::value<std::string>()
|
||||||
->default_value("a.out")->implicit_value("b.def"), "BIN")
|
->default_value("a.out")->implicit_value("b.def"), "BIN")
|
||||||
|
("x", "A short-only option", cxxopts::value<std::string>())
|
||||||
("positional",
|
("positional",
|
||||||
"Positional arguments: these are the arguments that are entered "
|
"Positional arguments: these are the arguments that are entered "
|
||||||
"without an option", cxxopts::value<std::vector<std::string>>())
|
"without an option", cxxopts::value<std::vector<std::string>>())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user