1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2024-06-16 06:25:23 +00:00

Added option -v to display version number and build date

This commit is contained in:
Kim Holviala 2016-01-01 11:52:05 +02:00
parent 3870019900
commit e7dcd868c0
2 changed files with 7 additions and 1 deletions

1
README
View File

@ -43,6 +43,7 @@ Command line options:
-nr Disable root user checking (for debugging)
-d Debug to syslog (not for production use)
-v Display version number and build date
-b Display the BSD license
-? Display this help

View File

@ -97,7 +97,7 @@ void parse_args(state *st, int argc, char *argv[])
int opt;
/* Parse args */
while ((opt = getopt(argc, argv, "h:p:r:t:g:a:c:u:m:l:w:o:s:i:k:f:e:R:D:L:A:P:n:db?-")) != ERROR) {
while ((opt = getopt(argc, argv, "h:p:r:t:g:a:c:u:m:l:w:o:s:i:k:f:e:R:D:L:A:P:n:dbv?-")) != ERROR) {
switch(opt) {
case 'h': sstrlcpy(st->server_host, optarg); break;
case 'p': st->server_port = atoi(optarg); break;
@ -145,6 +145,11 @@ void parse_args(state *st, int argc, char *argv[])
case 'd': st->debug = TRUE; break;
case 'b': puts(license); exit(EXIT_SUCCESS);
case 'v':
printf("%s/%s \"%s\" (built %s)\n", SERVER_SOFTWARE, VERSION, CODENAME, __DATE__);
exit(EXIT_SUCCESS);
default : puts(readme); exit(EXIT_SUCCESS);
}
}