From 4eefcaf3f6471972dbb8c1c6e037ae62c7cb5ce9 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 24 May 2014 00:24:47 -0700 Subject: Add -version option to print program version Signed-off-by: Alan Coopersmith --- misc.c | 7 ++++++- xfwp.man | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/misc.c b/misc.c index a8278eb..c7e609e 100644 --- a/misc.c +++ b/misc.c @@ -71,7 +71,7 @@ Usage(void) (void) fprintf (stderr, "\t[-cdt <#secs>] [-pmport ] [-config ]\\\n"); (void) fprintf (stderr, - "\t[-logfile ] [-loglevel <0|1>] [-verify]\n"); + "\t[-logfile ] [-loglevel <0|1>] [-verify] [-version]\n"); exit (0); } @@ -1344,6 +1344,11 @@ doProcessInputArgs ( } config_info->log_level = atoi(argv[arg_counter + 1]); } + else if (!strcmp("-version", argv[arg_counter])) + { + puts(PACKAGE_STRING); + exit(0); + } else { fprintf(stderr, "%s: Unrecognized command line argument '%s'\n", diff --git a/xfwp.man b/xfwp.man index 5d3ddb2..f738d5e 100644 --- a/xfwp.man +++ b/xfwp.man @@ -94,6 +94,9 @@ default is 10. .B \-max_pm_conns \fInum_connections\fP Used to specify the maximum number of X server connections. The default is 100. +.TP 8 +.B \-version +Used to print the program version and exit. .PP .SH DESCRIPTION The X firewall proxy (xfwp) is an application layer gateway proxy -- cgit v1.2.3