diff svr-runopts.c @ 946:17d874ae93a1

Add '-V' for version -h should exit with success Update manpages
author Matt Johnston <matt@ucc.asn.au>
date Sun, 27 Jul 2014 22:06:26 +0800
parents 5bfce5dcd461
children f92eb625c48d
line wrap: on
line diff
--- a/svr-runopts.c	Sat Jul 26 10:18:55 2014 +0800
+++ b/svr-runopts.c	Sun Jul 27 22:06:26 2014 +0800
@@ -92,6 +92,7 @@
 					"-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 @@
 #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 @@
 					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]);