Example of command line parsing.
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <visp3/core/vpDebug.h>
#include <visp3/io/vpParseArgv.h>
int main(int argc, const char **argv)
{
try {
using ::std::cout;
using ::std::endl;
bool bool_val = false;
int int_val = 3;
long long_val = 33333333;
float float_val = 3.14f;
double double_val = 3.1415;
char *string_val = NULL;
vpParseArgv::vpArgvInfo argTable[] = {
return (-1);
}
cout << "Your parameters: " << endl;
cout << " Bool value: " << bool_val << endl;
cout << " Integer value: " << int_val << endl;
cout << " Long value: " << long_val << endl;
cout << " Float value: " << float_val << endl;
cout << " Double value: " << double_val << endl;
if (string_val != NULL)
cout << " String value: " << string_val << endl;
else
cout << " String value: \"\"" << endl << endl;
cout << "Call " << argv[0] << " -h to see how to change these parameters." << endl;
return EXIT_SUCCESS;
return EXIT_FAILURE;
}
}