Example of command line parsing.
#include <visp/vpDebug.h>
#include <visp/vpParseArgv.h>
#include <stdio.h>
#include <sstream>
#include <iomanip>
int
main(int argc, const char ** argv)
{
try {
using ::std::cout;
using ::std::endl;
int i_val = 3;
float f_val = 3.14f;
double d_val = 3.1415;
int flag = 0;
vpParseArgv::vpArgvInfo argTable[] =
{
"Flag enabled."},
"An integer value."},
"A float value."},
"A double value."},
} ;
return (-1);
}
cout << "Your parameters: " << endl;
cout << " Integer value: " << i_val << endl;
cout << " Float value: " << f_val << endl;
cout << " Double value: " << d_val << endl << endl;
cout << " Flag : " << flag << endl << endl;
cout << "Call " << argv[0]
<< " -h to see how to change these parameters." << endl;
return 0;
}
std::cout << "Catch a ViSP exception: " << e << std::endl;
return 1;
}
}