From e3bcf806efd519d508e8fe61cc4de5d7ce89eb85 Mon Sep 17 00:00:00 2001 From: hadaq Date: Mon, 17 Oct 2011 20:58:05 +0000 Subject: [PATCH] added -V option --- trbnetd/server/trbnetd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/trbnetd/server/trbnetd.c b/trbnetd/server/trbnetd.c index eada7cb..13f3edd 100644 --- a/trbnetd/server/trbnetd.c +++ b/trbnetd/server/trbnetd.c @@ -14,6 +14,8 @@ #include "trbrpc.h" +static const char trbnetd_version[] = "$Revision: 1.11 $"; + int trbnetrpcprog_1_freeresult(SVCXPRT * transp, xdrproc_t xdr_result, caddr_t result) { @@ -358,6 +360,7 @@ void usage(const char *progName) fprintf(stdout, "Options:\n"); fprintf(stdout, " -h give this help\n"); fprintf(stdout, " -f execute as foreground process\n"); + fprintf(stdout, " -V version number\n"); } static pid_t myPid = -1; @@ -370,7 +373,7 @@ int main(int argc, char **argv) int opt; optind = 1; - while ((opt = getopt(argc, argv, "+hfd:")) != -1) { + while ((opt = getopt(argc, argv, "+hfVd:")) != -1) { switch (opt) { case '?': usage(basename(argv[0])); @@ -384,6 +387,11 @@ int main(int argc, char **argv) case 'd': trb_debug = strtoul(optarg, NULL, 0); break; + case 'V': + printf("%s %s, using libtrbnet %s\n", + basename(argv[0]), trbnetd_version, trbnet_version); + exit(EXIT_SUCCESS); + break; default: break; -- 2.43.0