[cig-commits] r11576 - cs/benchmark/cigma/trunk/src
luis at geodynamics.org
luis at geodynamics.org
Wed Mar 26 08:02:33 PDT 2008
Author: luis
Date: 2008-03-26 08:02:32 -0700 (Wed, 26 Mar 2008)
New Revision: 11576
Modified:
cs/benchmark/cigma/trunk/src/PointsReader.cpp
cs/benchmark/cigma/trunk/src/PointsReader.h
Log:
PointsReader needs to accept a prefix when calling its load_args() method
Modified: cs/benchmark/cigma/trunk/src/PointsReader.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/PointsReader.cpp 2008-03-26 15:02:31 UTC (rev 11575)
+++ cs/benchmark/cigma/trunk/src/PointsReader.cpp 2008-03-26 15:02:32 UTC (rev 11576)
@@ -26,10 +26,20 @@
{
assert(opt != 0);
+ // remember the original option prefix
+ this->pointsOption = "--";
+ this->pointsOption += opt_prefix;
+
+ //
+ // Note that in this case, the name of key to be read
+ // is the whole prefix. The caller needs to determine
+ // the appropriate name, which will typically correspond
+ // to an option called --{first,second}-{points,values}
+ //
char *in;
- string optstr;
+ string optstr = opt_prefix;
- in = opt->getValue("points");
+ in = opt->getValue(optstr.c_str());
if (in != 0)
{
this->pointsPath = in;
@@ -38,10 +48,15 @@
void PointsReader::validate_args(const char *cmd_name)
{
+ //
+ // Check for missing options
+ //
+
if (pointsPath == "")
{
cerr << cmd_name << ": "
- << "Missing option --points"
+ << "Missing option "
+ << pointsOption
<< endl;
exit(1);
}
Modified: cs/benchmark/cigma/trunk/src/PointsReader.h
===================================================================
--- cs/benchmark/cigma/trunk/src/PointsReader.h 2008-03-26 15:02:31 UTC (rev 11575)
+++ cs/benchmark/cigma/trunk/src/PointsReader.h 2008-03-26 15:02:32 UTC (rev 11576)
@@ -20,6 +20,7 @@
void load_points();
public:
+ std::string pointsOption;
std::string pointsPath;
std::string pointsLoc;
std::string pointsFile;
More information about the cig-commits
mailing list