| 4657 | typedef CLARA_AUTO_PTR( Arg ) ArgAutoPtr; |
| 4658 | |
| 4659 | friend void addOptName( Arg& arg, std::string const& optName ) |
| 4660 | { |
| 4661 | if( optName.empty() ) |
| 4662 | return; |
| 4663 | if( Detail::startsWith( optName, "--" ) ) { |
| 4664 | if( !arg.longName.empty() ) |
| 4665 | throw std::logic_error( "Only one long opt may be specified. '" |
| 4666 | + arg.longName |
| 4667 | + "' already specified, now attempting to add '" |
| 4668 | + optName + "'" ); |
| 4669 | arg.longName = optName.substr( 2 ); |
| 4670 | } |
| 4671 | else if( Detail::startsWith( optName, "-" ) ) |
| 4672 | arg.shortNames.push_back( optName.substr( 1 ) ); |
| 4673 | else |
| 4674 | throw std::logic_error( "option must begin with - or --. Option was: '" + optName + "'" ); |
| 4675 | } |
| 4676 | friend void setPositionalArg( Arg& arg, int position ) |
| 4677 | { |
| 4678 | arg.position = position; |
nothing calls this directly
no test coverage detected