Ignore case. Subcommands inherit value.
| 4989 | |
| 4990 | /// Ignore case. Subcommands inherit value. |
| 4991 | App *ignore_case(bool value = true) { |
| 4992 | if (value && !ignore_case_) { |
| 4993 | ignore_case_ = true; |
| 4994 | auto *p = (parent_ != nullptr) ? _get_fallthrough_parent() : this; |
| 4995 | auto &match = _compare_subcommand_names(*this, *p); |
| 4996 | if (!match.empty()) { |
| 4997 | ignore_case_ = false; // we are throwing so need to be exception invariant |
| 4998 | throw OptionAlreadyAdded("ignore case would cause subcommand name conflicts: " + match); |
| 4999 | } |
| 5000 | } |
| 5001 | ignore_case_ = value; |
| 5002 | return this; |
| 5003 | } |
| 5004 | |
| 5005 | /// Allow windows style options, such as `/opt`. First matching short or long name used. Subcommands inherit |
| 5006 | /// value. |
no test coverage detected