| 4640 | } |
| 4641 | |
| 4642 | Mode handleOpt( std::size_t i, char c, std::string const& arg, std::vector<Token>& tokens ) { |
| 4643 | if( std::string( ":=\0", 3 ).find( c ) == std::string::npos ) |
| 4644 | return mode; |
| 4645 | |
| 4646 | std::string optName = arg.substr( from, i-from ); |
| 4647 | if( mode == ShortOpt ) |
| 4648 | for( std::size_t j = 0; j < optName.size(); ++j ) |
| 4649 | tokens.push_back( Token( Token::ShortOpt, optName.substr( j, 1 ) ) ); |
| 4650 | else if( mode == SlashOpt && optName.size() == 1 ) |
| 4651 | tokens.push_back( Token( Token::ShortOpt, optName ) ); |
| 4652 | else |
| 4653 | tokens.push_back( Token( Token::LongOpt, optName ) ); |
| 4654 | return None; |
| 4655 | } |
| 4656 | Mode handlePositional( std::size_t i, char c, std::string const& arg, std::vector<Token>& tokens ) { |
| 4657 | if( inQuotes || std::string( "\0", 1 ).find( c ) == std::string::npos ) |
| 4658 | return mode; |