void CommandLineParser::readNonOptionCommands() { if ( argumentStartsWith( ":" ) ) m_testPath = getNextArgument().substr( 1 ); else { CommandLinePlugInInfo plugIn; int indexParameter = getCurrentArgument().find( '=' ); if ( indexParameter < 0 ) plugIn.m_fileName = getCurrentArgument(); else { plugIn.m_fileName = getCurrentArgument().substr( 0, indexParameter ); std::string parameters = getCurrentArgument().substr( indexParameter +1 ); plugIn.m_parameters = CPPUNIT_NS::PlugInParameters( parameters ); } m_plugIns.push_back( plugIn ); getNextArgument(); } }
void CClctrl::unrecognisedFlag() { exitError("Unrecognised flag: " + getCurrentArgument() + " under " + getMode() + " command."); }
void CClctrl::confirmCurrentArg(string commandName) { if(getCurrentArgument()!=commandName) exitError("Unrecognised argument " + getCurrentArgument() + " for `" + getMode() + "' command."); }
bool CClctrl::isCurrentArg(string shortName, string commandName) { return (getCurrentArgument()==shortName || getCurrentArgument()==commandName); }
bool CommandLineParser::argumentStartsWith( const std::string &expected ) const { return getCurrentArgument().substr( 0, expected.length() ) == expected; }