本文整理汇总了C++中ArgParse::error_message方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgParse::error_message方法的具体用法?C++ ArgParse::error_message怎么用?C++ ArgParse::error_message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgParse
的用法示例。
在下文中一共展示了ArgParse::error_message方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: param
static void
getargs (int argc, const char *argv[])
{
static bool help = false;
ArgParse ap;
ap.options ("Usage: testshade [options] shader...",
"%*", add_shader, "",
"--help", &help, "Print help message",
"-v", &verbose, "Verbose messages",
"--debug", &debug, "Lots of debugging info",
"--stats", &stats, "Print run statistics",
"-g %d %d", &xres, &yres, "Make an X x Y grid of shading points",
"-o %L %L", &outputvars, &outputfiles,
"Output (variable, filename)",
"-od %s", &dataformatname, "Set the output data format to one of:\n"
"\t\t\t\tuint8, half, float",
"--layer %s", &layername, "Set next layer name",
"--fparam %L %L",
&fparams, &fparams,
"Add a float param (args: name value)",
"--iparam %L %L",
&iparams, &iparams,
"Add an integer param (args: name value)",
"--vparam %L %L %L %L",
&vparams, &vparams, &vparams, &vparams,
"Add a vector or color param (args: name x y z)",
"--sparam %L %L",
&sparams, &sparams,
"Add a string param (args: name value)",
"--connect %L %L %L %L",
&connections, &connections, &connections, &connections,
"Connect fromlayer fromoutput tolayer toinput",
"--raytype %s", &raytype, "Set the raytype",
"--iters %d", &iters, "Number of iterations",
"-O0", &O0, "Do no runtime shader optimization",
"-O1", &O1, "Do a little runtime shader optimization",
"-O2", &O2, "Do lots of runtime shader optimization",
// "-v", &verbose, "Verbose output",
NULL);
if (ap.parse(argc, argv) < 0 || shadernames.empty()) {
std::cerr << ap.error_message() << std::endl;
ap.usage ();
exit (EXIT_FAILURE);
}
if (help) {
std::cout <<
"testshade -- Test Open Shading Language\n"
"(c) Copyright 2009-2010 Sony Pictures Imageworks Inc. All Rights Reserved.\n";
ap.usage ();
exit (EXIT_SUCCESS);
}
}