Skip to content

Commit

Permalink
Print long names in help option
Browse files Browse the repository at this point in the history
  • Loading branch information
amirsojoodi authored Nov 30, 2023
1 parent 554396b commit dfeeffc
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions include/cxxopts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2088,9 +2088,21 @@ format_option
result += " ";
}

if (!l.empty())
auto is_first_name = true;
for (const auto& name : o.l)
{
result += " --" + toLocalString(l);
if (!name.empty())
{
if (is_first_name)
{
result += " --" + toLocalString(name);
is_first_name = false;
}
else
{
result += ", --" + toLocalString(name);
}
}
}

auto arg = !o.arg_help.empty() ? toLocalString(o.arg_help) : "arg";
Expand Down

0 comments on commit dfeeffc

Please sign in to comment.