|
35 | 35 | #include <string> |
36 | 36 | #include <vector> |
37 | 37 |
|
| 38 | +#include "base/intern_string.hh" |
| 39 | + |
38 | 40 | enum class help_context_t { |
39 | 41 | HC_NONE, |
40 | 42 | HC_PARAMETER, |
@@ -120,7 +122,7 @@ struct help_text { |
120 | 122 | std::vector<help_example> ht_example; |
121 | 123 | help_nargs_t ht_nargs{help_nargs_t::HN_REQUIRED}; |
122 | 124 | help_parameter_format_t ht_format{help_parameter_format_t::HPF_STRING}; |
123 | | - std::vector<const char*> ht_enum_values; |
| 125 | + std::vector<string_fragment> ht_enum_values; |
124 | 126 | std::vector<const char*> ht_tags; |
125 | 127 | std::vector<const char*> ht_opposites; |
126 | 128 | help_function_type_t ht_function_type{help_function_type_t::HFT_REGULAR}; |
@@ -274,21 +276,21 @@ struct help_text { |
274 | 276 | bool is_trailing_arg() const; |
275 | 277 |
|
276 | 278 | help_text& with_enum_values( |
277 | | - const std::initializer_list<const char*>& enum_values) noexcept; |
| 279 | + const std::initializer_list<string_fragment>& enum_values) noexcept; |
278 | 280 |
|
279 | 281 | template<std::size_t N> |
280 | 282 | help_text& with_enum_values( |
281 | | - const std::array<const char*, N>& enum_values) noexcept |
| 283 | + const std::array<string_fragment, N>& enum_values) noexcept |
282 | 284 | { |
283 | 285 | this->ht_enum_values.reserve(N); |
284 | | - for (const auto* val : enum_values) { |
| 286 | + for (const auto& val : enum_values) { |
285 | 287 | this->ht_enum_values.emplace_back(val); |
286 | 288 | } |
287 | 289 |
|
288 | 290 | return *this; |
289 | 291 | } |
290 | 292 |
|
291 | | - help_text& with_enum_values(const std::vector<const char*>& ev) |
| 293 | + help_text& with_enum_values(const std::vector<string_fragment>& ev) |
292 | 294 | { |
293 | 295 | this->ht_enum_values = ev; |
294 | 296 | return *this; |
|
0 commit comments