change for xor bug

This commit is contained in:
mes5k 2005-01-21 04:04:56 +00:00
parent 3c55406797
commit 7790b03c61

View File

@ -56,6 +56,10 @@ void parseOptions(int argc, char** argv)
xorlist.push_back(&gtest);
cmd.xorAdd( xorlist );
MultiArg<string> itest("i", "iii", "or test i", true, "string");
MultiArg<string> jtest("j", "jjj", "or test j", true, "string");
cmd.xorAdd( itest, jtest );
//
// Parse the command line.
//
@ -87,6 +91,24 @@ void parseOptions(int argc, char** argv)
else
throw("still bad");
if ( jtest.isSet() )
{
cout << "for J:" << endl;
vector<string> v = jtest.getValue();
for ( int z = 0; (unsigned int)z < v.size(); z++ )
cout << " " << z << " " << v[z] << endl;
}
else if ( itest.isSet() )
{
cout << "for I:" << endl;
vector<string> v = itest.getValue();
for ( int z = 0; (unsigned int)z < v.size(); z++ )
cout << " " << z << " " << v[z] << endl;
}
else
throw("yup, still bad");
} catch ( ArgException& e )
{ cout << "ERROR: " << e.error() << " " << e.argId() << endl; }