Set a help flag, replace the existing one if present
| 5171 | |
| 5172 | /// Set a help flag, replace the existing one if present |
| 5173 | Option *set_help_flag(std::string flag_name = "", const std::string &help_description = "") { |
| 5174 | // take flag_description by const reference otherwise add_flag tries to assign to help_description |
| 5175 | if (help_ptr_ != nullptr) { |
| 5176 | remove_option(help_ptr_); |
| 5177 | help_ptr_ = nullptr; |
| 5178 | } |
| 5179 | |
| 5180 | // Empty name will simply remove the help flag |
| 5181 | if (!flag_name.empty()) { |
| 5182 | help_ptr_ = add_flag(flag_name, help_description); |
| 5183 | help_ptr_->configurable(false); |
| 5184 | } |
| 5185 | |
| 5186 | return help_ptr_; |
| 5187 | } |
| 5188 | |
| 5189 | /// Set a help all flag, replaced the existing one if present |
| 5190 | Option *set_help_all_flag(std::string help_name = "", const std::string &help_description = "") { |
no test coverage detected