Skip to content

Commit

Permalink
utils/program-options: selection_value: make get_candidate_names() pu…
Browse files Browse the repository at this point in the history
…blic

To allow application code query available candidates, before making a
choice.

Closes #2550
  • Loading branch information
denesb authored and xemul committed Nov 26, 2024
1 parent b63b02a commit fdb124e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/seastar/util/program-options.hh
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ private:
size_t _selected_candidate = no_selected_candidate;
bool _defaulted = true;

private:
public:
std::vector<std::string> get_candidate_names() const {
std::vector<std::string> candidate_names;
candidate_names.reserve(_candidates.size());
Expand All @@ -543,6 +543,7 @@ private:
}
return candidate_names;
}
private:
virtual void do_describe(options_descriptor& descriptor) const override {
descriptor.visit_selection_value(get_candidate_names(), _selected_candidate == no_selected_candidate ? nullptr : &_selected_candidate);
for (auto& c : _candidates) {
Expand Down

0 comments on commit fdb124e

Please sign in to comment.