Added the usage report to the examples for when no arguments are passed

to the examples.
This commit is contained in:
Robert Osfield
2003-04-06 21:32:44 +00:00
parent 908164d58a
commit 49a28660dc
40 changed files with 166 additions and 72 deletions

View File

@@ -585,7 +585,7 @@ int main( int argc, char **argv )
osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getProgramName()+" [options] filename ...");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
@@ -615,6 +615,12 @@ int main( int argc, char **argv )
return 1;
}
if (arguments.argc()<=1)
{
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
return 1;
}
// load the nodes from the commandline arguments.
osg::Node* loadedModel = osgDB::readNodeFiles(arguments);