MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / validate

Method validate

unittests/catch.hpp:6235–6250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6233 }
6234
6235 auto validate() const -> Result override {
6236 if( m_optNames.empty() )
6237 return Result::logicError( "No options supplied to Opt" );
6238 for( auto const &name : m_optNames ) {
6239 if( name.empty() )
6240 return Result::logicError( "Option name cannot be empty" );
6241#ifdef CATCH_PLATFORM_WINDOWS
6242 if( name[0] != '-' && name[0] != '/' )
6243 return Result::logicError( "Option name must begin with '-' or '/'" );
6244#else
6245 if( name[0] != '-' )
6246 return Result::logicError( "Option name must begin with '-'" );
6247#endif
6248 }
6249 return ParserRefImpl::validate();
6250 }
6251 };
6252
6253 struct Help : Opt {

Callers 1

validateMethod · 0.45

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected