From 67722bec5a7b63e477c8c8f880570e7a3d8960aa Mon Sep 17 00:00:00 2001 From: "Emden R. Gansner" Date: Wed, 19 Jun 2013 16:28:56 -0400 Subject: [PATCH] Add -V option to smyrna; update version information in smyrna.glade (This last should be automated.) --- cmd/smyrna/main.c | 16 ++++++++++++++-- share/gui/smyrna.glade | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/cmd/smyrna/main.c b/cmd/smyrna/main.c index ae96e2ae9..91e5c098e 100755 --- a/cmd/smyrna/main.c +++ b/cmd/smyrna/main.c @@ -15,6 +15,7 @@ #ifdef HAVE_CONFIG_H # include #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?] \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); diff --git a/share/gui/smyrna.glade b/share/gui/smyrna.glade index 022f23e15..51d2fde0e 100755 --- a/share/gui/smyrna.glade +++ b/share/gui/smyrna.glade @@ -6,7 +6,7 @@ 900 700 - Smyrna Graph visualizer ver: 1.0 ATT + Smyrna Graph Visualizer ver: 2.0 ATT (17 June 2013) GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER False -- 2.40.0