aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-03-02 19:02:48 -0800
committerGarrett D'Amore <garrett@damore.org>2018-03-02 19:03:08 -0800
commitf305f28c8dbac109c1038d430c7125222ee90703 (patch)
treedcba1b998c1eb3d8f2bd10283ab2721251f6a535 /tools
parenta315244fc92aaed52cd4c620521c797c7a0b5f4c (diff)
downloadnng-f305f28c8dbac109c1038d430c7125222ee90703.tar.gz
nng-f305f28c8dbac109c1038d430c7125222ee90703.tar.bz2
nng-f305f28c8dbac109c1038d430c7125222ee90703.zip
fixes #254 nngcat should have a --version option
We only add a basic --version (also -V). I'm still trying to figure out how to convince cmake to emit its compilation flags into a file where we can use them for output.
Diffstat (limited to 'tools')
-rw-r--r--tools/nngcat/nngcat.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/nngcat/nngcat.c b/tools/nngcat/nngcat.c
index 2f5ef563..064e4635 100644
--- a/tools/nngcat/nngcat.c
+++ b/tools/nngcat/nngcat.c
@@ -96,6 +96,7 @@ enum options {
OPT_CACERT,
OPT_KEYFILE,
OPT_CERTFILE,
+ OPT_VERSION,
};
static nng_optspec opts[] = {
@@ -179,6 +180,7 @@ static nng_optspec opts[] = {
.o_val = OPT_CERTFILE,
.o_arg = true,
},
+ { .o_name = "version", .o_short = 'V', .o_val = OPT_VERSION },
// Sentinel.
{ .o_name = NULL, .o_val = 0 },
@@ -784,6 +786,9 @@ main(int ac, const char **av)
case OPT_INSECURE:
insecure = 1;
break;
+ case OPT_VERSION:
+ printf("%s\n", nng_version());
+ exit(0);
}
}
switch (rv) {