Skip to content

Commit

Permalink
command_line/options: Implemented a helper on optionsStorage_t for th…
Browse files Browse the repository at this point in the history
…e help display, cleaning up the API
  • Loading branch information
dragonmux committed Aug 16, 2023
1 parent 162d439 commit 4da4039
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions substrate/command_line/options
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ namespace substrate::commandLine
constexpr optionsStorage_t &operator =(const optionsStorage_t &) noexcept = default;
constexpr optionsItem_t operator [](const size_t index) const { return optionAt<0U>(index, _options); }
constexpr auto &options() const noexcept { return _options; }

void displayHelp() const noexcept;
};

template<typename... options_t> optionsStorage_t(const std::tuple<options_t...> &) ->
Expand Down Expand Up @@ -313,6 +315,13 @@ namespace substrate::commandLine
[[nodiscard]] size_t displayPadding() const noexcept;
void displayHelp() const noexcept;
};

template<typename... options_t>
void optionsStorage_t<options_t...>::displayHelp() const noexcept
{
optionsHolder_t holder{*this};
holder.displayHelp();
}
}

// The base container for a program's command line options
Expand Down

0 comments on commit 4da4039

Please sign in to comment.