| 4261 | typedef CLARA_AUTO_PTR( Arg ) ArgAutoPtr; |
| 4262 | |
| 4263 | friend void addOptName( Arg& arg, std::string const& optName ) |
| 4264 | { |
| 4265 | if( optName.empty() ) |
| 4266 | return; |
| 4267 | if( Detail::startsWith( optName, "--" ) ) { |
| 4268 | if( !arg.longName.empty() ) |
| 4269 | throw std::logic_error( "Only one long opt may be specified. '" |
| 4270 | + arg.longName |
| 4271 | + "' already specified, now attempting to add '" |
| 4272 | + optName + "'" ); |
| 4273 | arg.longName = optName.substr( 2 ); |
| 4274 | } |
| 4275 | else if( Detail::startsWith( optName, "-" ) ) |
| 4276 | arg.shortNames.push_back( optName.substr( 1 ) ); |
| 4277 | else |
| 4278 | throw std::logic_error( "option must begin with - or --. Option was: '" + optName + "'" ); |
| 4279 | } |
| 4280 | friend void setPositionalArg( Arg& arg, int position ) |
| 4281 | { |
| 4282 | arg.position = position; |
nothing calls this directly
no test coverage detected