Skip to content

Commit

Permalink
command_line:options: Clean up some clang-tidy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonmux committed Oct 13, 2024
1 parent 86ba954 commit d1ef502
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions impl/command_line/options.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ namespace substrate::commandLine
return std::nullopt;
}

// NOTLINENEXTLINE(readability-convert-member-functions-to-static)
std::optional<std::any> option_t::parseSignedValue(const std::string_view &value) const noexcept
{
toInt_t<int64_t> number{value.data()};
Expand All @@ -78,6 +79,7 @@ namespace substrate::commandLine
return result;
}

// NOTLINENEXTLINE(readability-convert-member-functions-to-static)
std::optional<std::any> option_t::parseUnsignedValue(const std::string_view &value) const noexcept
{
toInt_t<uint64_t> number{value.data()};
Expand All @@ -99,6 +101,7 @@ namespace substrate::commandLine
return result;
}

// NOTLINENEXTLINE(readability-convert-member-functions-to-static)
std::optional<std::any> option_t::parseBoolValue(const std::string_view &value) noexcept
{
// If the value matches the strings "true" or "false", convert to the boolean equivilent
Expand All @@ -110,6 +113,7 @@ namespace substrate::commandLine
return std::nullopt;
}

// NOTLINENEXTLINE(readability-convert-member-functions-to-static)
std::optional<std::any> option_t::parsePathValue(const std::string_view &value) noexcept
{
// There's unfortunately not much of any validation can be done on a path, so..
Expand All @@ -121,6 +125,7 @@ namespace substrate::commandLine
bool optionAlternation_t::matches(const std::string_view &argument) const noexcept
{ return argument == _value; }

// NOTLINENEXTLINE(readability-convert-member-functions-to-static)
std::optional<std::reference_wrapper<const optionAlternation_t>>
optionSet_t::matches(const std::string_view &argument) const noexcept
{
Expand All @@ -141,6 +146,7 @@ namespace substrate::commandLine
);
}

// NOTLINENEXTLINE(readability-convert-member-functions-to-static)
void optionSet_t::displayHelp(const size_t padding) const noexcept
{
console.writeln();
Expand Down Expand Up @@ -205,6 +211,7 @@ namespace substrate::commandLine
substrate::unreachable();
}

// NOTLINENEXTLINE(readability-convert-member-functions-to-static)
[[nodiscard]] std::string option_t::displayName() const noexcept
{
if (_option.valueless_by_exception())
Expand All @@ -227,6 +234,7 @@ namespace substrate::commandLine
}, _option);
}

// NOTLINENEXTLINE(readability-convert-member-functions-to-static)
[[nodiscard]] size_t option_t::displayLength() const noexcept
{
const auto value_length
Expand Down Expand Up @@ -274,6 +282,7 @@ namespace substrate::commandLine
);
}

// NOTLINENEXTLINE(readability-convert-member-functions-to-static)
void optionsHolder_t::displayHelp() const noexcept
{
// Figure out how much padding is needed to make everything neat
Expand Down

0 comments on commit d1ef502

Please sign in to comment.