From 4d872ca9c7cd1745e017b2eb5a8a359919e34492 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 13 Jan 2010 20:37:47 +0000 Subject: [PATCH] options to report version string, etc. --- direct/src/plugin_standalone/panda3d.cxx | 31 ++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/direct/src/plugin_standalone/panda3d.cxx b/direct/src/plugin_standalone/panda3d.cxx index d634c3c0ff..af38fab6e0 100644 --- a/direct/src/plugin_standalone/panda3d.cxx +++ b/direct/src/plugin_standalone/panda3d.cxx @@ -63,7 +63,7 @@ run_command_line(int argc, char *argv[]) { // We prefix a "+" sign to tell gnu getopt not to parse options // following the first not-option parameter. (These will be passed // into the sub-process.) - const char *optstr = "+mu:M:Sp:fw:t:s:o:l:ih"; + const char *optstr = "+mu:M:Sp:fw:t:s:o:l:iVUPh"; bool allow_multiple = false; @@ -161,6 +161,24 @@ run_command_line(int argc, char *argv[]) { } break; + case 'V': + cout << P3D_PLUGIN_MAJOR_VERSION << "." + << P3D_PLUGIN_MINOR_VERSION << "." + << P3D_PLUGIN_SEQUENCE_VERSION; +#ifndef PANDA_OFFICIAL_VERSION + cout << "c"; +#endif + cout << "\n"; + exit(0); + + case 'U': + cout << PANDA_PACKAGE_HOST_URL << "\n"; + exit(0); + + case 'P': + cout << DTOOL_PLATFORM << "\n"; + exit(0); + case 'h': case '?': case '+': @@ -784,5 +802,14 @@ usage() { << " -p platform\n" << " Specify the platform to masquerade as. The default is \"" - << DTOOL_PLATFORM << "\" .\n\n"; + << DTOOL_PLATFORM << "\" .\n\n" + + << " -V\n" + << " Output only the plugin version string and exit immediately.\n\n" + + << " -U\n" + << " Output only the plugin host URL and exit immediately.\n\n" + + << " -P\n" + << " Output only the plugin platform string and exit immediately.\n\n"; }