summaryrefslogtreecommitdiff
path: root/nDPIsrvd.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-06-08 15:23:33 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-06-08 15:23:33 +0200
commita41ddafa88de870aadad4acdf0193ac3a326c403 (patch)
treeb4400a61a9738620510aa57706e1349c20253727 /nDPIsrvd.c
parent30502ff0a0d12e8f1a39c3366d14a3f443051e65 (diff)
Git tag/commit version printing for nDPId/nDPIsrvd. Reduces confusion.
* disabled subshell spawn for run_tests.sh, common pitfall while using counters Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'nDPIsrvd.c')
-rw-r--r--nDPIsrvd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/nDPIsrvd.c b/nDPIsrvd.c
index d16768ed9..0e86a84d5 100644
--- a/nDPIsrvd.c
+++ b/nDPIsrvd.c
@@ -227,7 +227,7 @@ static int nDPIsrvd_parse_options(int argc, char ** argv)
{
int opt;
- while ((opt = getopt(argc, argv, "hlc:dp:s:u:g:")) != -1)
+ while ((opt = getopt(argc, argv, "lc:dp:s:u:g:vh")) != -1)
{
switch (opt)
{
@@ -257,10 +257,16 @@ static int nDPIsrvd_parse_options(int argc, char ** argv)
free(nDPIsrvd_options.group);
nDPIsrvd_options.group = strdup(optarg);
break;
+ case 'v':
+ fprintf(stderr, "%s", get_nDPId_version());
+ return 1;
+ case 'h':
default:
+ fprintf(stderr, "%s\n", get_nDPId_version());
fprintf(stderr,
- "Usage: %s [-l] [-c path-to-unix-sock] [-d] [-p pidfile] "
- "[-s path-to-unix-socket|distributor-host:port] [-u user] [-g group]\n",
+ "Usage: %s [-l] [-c path-to-unix-sock] [-d] [-p pidfile]\n"
+ "\t[-s path-to-unix-socket|distributor-host:port] [-u user] [-g group]\n"
+ "\t[-v] [-h]\n",
argv[0]);
return 1;
}