Skip to content

Commit

Permalink
command_line/options: Handle better displaying the set name in option…
Browse files Browse the repository at this point in the history
…Set_t::displayHelp()

It is known by the author that the upper-casing of the meta name will break if given non-ASCII characters, but C++ does not provide a good means to solve this for now.
  • Loading branch information
dragonmux committed Aug 15, 2023
1 parent 0d074ec commit 1f2c43e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions impl/command_line/options.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ namespace substrate::commandLine
void optionSet_t::displayHelp(const size_t padding) const noexcept
{
console.writeln();
// XXX: Need to capitalise the first letter.
console.writeln(metaName(), "s:"sv);
const auto &metaName{_metaName.substr(1)};
console.writeln(std::toupper(_metaName[0], std::locale::classic()), metaName, "s:"sv);
for (const auto &alternation : _alternations)
{
console.writeln('\t', alternation.displayName(), nullptr);
Expand Down

0 comments on commit 1f2c43e

Please sign in to comment.