summaryrefslogtreecommitdiffhomepage
path: root/svr-runopts.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2014-07-27 22:06:26 +0800
committerMatt Johnston <matt@ucc.asn.au>2014-07-27 22:06:26 +0800
commited0552f21417ffb90d52ac12becb03cf6a03e13c (patch)
tree10929da2b6d8a4d48058825a9e3b68e1d33bc43a /svr-runopts.c
parent5cf83a7212c0f353e7367766cc4bbf349e83ff0b (diff)
Add '-V' for version
-h should exit with success Update manpages
Diffstat (limited to 'svr-runopts.c')
-rw-r--r--svr-runopts.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/svr-runopts.c b/svr-runopts.c
index 414cb45..ad946bc 100644
--- a/svr-runopts.c
+++ b/svr-runopts.c
@@ -92,6 +92,7 @@ static void printhelp(const char * progname) {
"-W <receive_window_buffer> (default %d, larger may be faster, max 1MB)\n"
"-K <keepalive> (0 is never, default %d, in seconds)\n"
"-I <idle_timeout> (0 is never, default %d, in seconds)\n"
+ "-V Version\n"
#ifdef DEBUG_TRACE
"-v verbose (compiled with DEBUG_TRACE)\n"
#endif
@@ -256,7 +257,7 @@ void svr_getopts(int argc, char ** argv) {
#endif
case 'h':
printhelp(argv[0]);
- exit(EXIT_FAILURE);
+ exit(EXIT_SUCCESS);
break;
case 'u':
/* backwards compatibility with old urandom option */
@@ -266,6 +267,10 @@ void svr_getopts(int argc, char ** argv) {
debug_trace = 1;
break;
#endif
+ case 'V':
+ print_version("server");
+ exit(EXIT_SUCCESS);
+ break;
default:
fprintf(stderr, "Unknown argument %s\n", argv[i]);
printhelp(argv[0]);