This is the function to expand if you want to support a new type.
| 141 | |
| 142 | // This is the function to expand if you want to support a new type. |
| 143 | bool FlagList::parse_flag_info(FlagInfo& info, token_iterator_t* iterator) { |
| 144 | bool success = false; |
| 145 | |
| 146 | std::visit( |
| 147 | [&](auto&& item) { |
| 148 | using T = std::decay_t<decltype(item.get())>; |
| 149 | if constexpr (std::is_same_v<T, Flag<bool>>) { |
| 150 | success = parse_bool_flag(item.get(), info.is_short, **iterator); |
| 151 | } else if constexpr (std::is_same_v<T, Flag<std::string>>) { |
| 152 | success = parse_flag(item.get(), info.is_short, iterator); |
| 153 | } else if constexpr (std::is_same_v<T, Flag<uint32_t>>) { |
| 154 | success = parse_flag(item.get(), info.is_short, iterator); |
| 155 | } else { |
| 156 | static_assert(always_false_v<T>, "Unsupported flag type."); |
| 157 | } |
| 158 | }, |
| 159 | info.flag); |
| 160 | |
| 161 | return success; |
| 162 | } |
| 163 | |
| 164 | bool FlagList::parse(token_t* argv) { |
| 165 | flags::positional_arguments.clear(); |
nothing calls this directly
no test coverage detected