Ejemplo n.º 1
0
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();
  }
}
Ejemplo n.º 2
0
void CClctrl::unrecognisedFlag()
{
  exitError("Unrecognised flag: " + getCurrentArgument() + " under " + getMode() +  " command.");
}
Ejemplo n.º 3
0
void CClctrl::confirmCurrentArg(string commandName)
{
  if(getCurrentArgument()!=commandName)
    exitError("Unrecognised argument " + getCurrentArgument() + " for `" + getMode() + "' command.");
}
Ejemplo n.º 4
0
bool CClctrl::isCurrentArg(string shortName, string commandName)
{
  return (getCurrentArgument()==shortName || getCurrentArgument()==commandName);
}
Ejemplo n.º 5
0
bool 
CommandLineParser::argumentStartsWith( const std::string &expected ) const
{
  return getCurrentArgument().substr( 0, expected.length() ) == expected;
}