]> granicus.if.org Git - graphviz/commitdiff
Add -V option to smyrna; update version information in smyrna.glade
authorEmden R. Gansner <erg@research.att.com>
Wed, 19 Jun 2013 20:28:56 +0000 (16:28 -0400)
committerEmden R. Gansner <erg@research.att.com>
Wed, 19 Jun 2013 20:28:56 +0000 (16:28 -0400)
(This last should be automated.)

cmd/smyrna/main.c
share/gui/smyrna.glade

index ae96e2ae9a96fa55e053ccc1ce0a3082baecca4f..91e5c098e9c98d4a2f1c26c613fdf1d2f8218b82 100755 (executable)
@@ -15,6 +15,7 @@
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
 #endif
+#include "builddate.h"
 //windows.h for win machines
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #define WIN32_LEAN_AND_MEAN 1
@@ -94,16 +95,22 @@ static char *useString = "Usage: smyrns [-v?] <file>\n\
 
 static void usage(int v)
 {
-    printf(useString);
+    fputs(useString, stdout);
     exit(v);
 }
 
+static char *Info[] = {
+    "smyrna",                   /* Program */
+    VERSION,                    /* Version */
+    BUILDDATE                   /* Build Date */
+};
+
 
 static char *parseArgs(int argc, char *argv[], ViewInfo * view)
 {
     unsigned int c;
 
-    while ((c = getopt(argc, argv, ":eKf:txv?")) != -1) {
+    while ((c = getopt(argc, argv, ":eKf:txvV?")) != -1) {
        switch (c) {
        case 'e':
            view->drawSplines = 1;
@@ -127,6 +134,11 @@ static char *parseArgs(int argc, char *argv[], ViewInfo * view)
            view->optArg=strdup(optarg);
            break;
 
+       case 'V':
+           fprintf(stderr, "%s version %s (%s)\n",
+                   Info[0], Info[1], Info[2]);
+           exit (0);
+           break;
        case '?':
            if (optopt == '?')
                usage(0);
index 022f23e15c9963a3360a7905429b9627e7eb4802..51d2fde0e4e8b389c796576b2fab602b0495bb71 100755 (executable)
@@ -6,7 +6,7 @@
 <widget class="GtkWindow" id="frmMain">
   <property name="width_request">900</property>
   <property name="height_request">700</property>
-  <property name="title" translatable="yes">Smyrna Graph visualizer ver: 1.0  ATT</property>
+  <property name="title" translatable="yes">Smyrna Graph Visualizer ver: 2.0  ATT (17 June 2013)</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_CENTER</property>
   <property name="modal">False</property>