David Rose 20 years ago
parent
commit
55a8c30818
1 changed files with 21 additions and 5 deletions
  1. 21 5
      panda/src/testbed/pview.cxx

+ 21 - 5
panda/src/testbed/pview.cxx

@@ -17,6 +17,7 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
 #include "pandaFramework.h"
 #include "pandaFramework.h"
+#include "pandaSystem.h"
 #include "textNode.h"
 #include "textNode.h"
 #include "configVariableBool.h"
 #include "configVariableBool.h"
 #include "texturePool.h"
 #include "texturePool.h"
@@ -221,11 +222,22 @@ help() {
     "  -s filename\n"
     "  -s filename\n"
     "      After displaying the models, immediately take a screenshot and\n"
     "      After displaying the models, immediately take a screenshot and\n"
     "      exit.\n\n"
     "      exit.\n\n"
+
+    "  -V\n"
+    "      Report the current version of Panda, and exit.\n\n"
     
     
     "  -h\n"
     "  -h\n"
     "      Display this help text.\n\n";
     "      Display this help text.\n\n";
 }
 }
 
 
+void 
+report_version() {
+  nout << "\n";
+  PandaSystem *ps = PandaSystem::get_global_ptr();
+  ps->write(nout);
+  nout << "\n";
+}
+
 int
 int
 main(int argc, char *argv[]) {
 main(int argc, char *argv[]) {
   framework.open_framework(argc, argv);
   framework.open_framework(argc, argv);
@@ -238,7 +250,7 @@ main(int argc, char *argv[]) {
 
 
   extern char *optarg;
   extern char *optarg;
   extern int optind;
   extern int optind;
-  static const char *optflags = "clhs:";
+  static const char *optflags = "cls:Vh";
   int flag = getopt(argc, argv, optflags);
   int flag = getopt(argc, argv, optflags);
 
 
   while (flag != EOF) {
   while (flag != EOF) {
@@ -250,16 +262,20 @@ main(int argc, char *argv[]) {
     case 'l':
     case 'l':
       show_loading = true;
       show_loading = true;
       break;
       break;
-
-    case 'h':
-      help();
-      return 1;
       
       
     case 's':
     case 's':
       auto_screenshot = true;
       auto_screenshot = true;
       screenshotfn = optarg;
       screenshotfn = optarg;
       break;
       break;
 
 
+    case 'V':
+      report_version();
+      return 1;
+
+    case 'h':
+      help();
+      return 1;
+
     case '?':
     case '?':
       usage();
       usage();
       return 1;
       return 1;