| 6037 | } |
| 6038 | |
| 6039 | auto validate() const -> Result override { |
| 6040 | if (m_optNames.empty()) |
| 6041 | return Result::logicError("No options supplied to Opt"); |
| 6042 | for (auto const &name : m_optNames) { |
| 6043 | if (name.empty()) |
| 6044 | return Result::logicError("Option name cannot be empty"); |
| 6045 | #ifdef CATCH_PLATFORM_WINDOWS |
| 6046 | if (name[0] != '-' && name[0] != '/') |
| 6047 | return Result::logicError("Option name must begin with '-' or '/'"); |
| 6048 | #else |
| 6049 | if (name[0] != '-') |
| 6050 | return Result::logicError("Option name must begin with '-'"); |
| 6051 | #endif |
| 6052 | } |
| 6053 | return ParserRefImpl::validate(); |
| 6054 | } |
| 6055 | }; |
| 6056 | |
| 6057 | struct Help : Opt { |