Add version info to lttng-relayd help
authorAnders Wallin <wallinux@gmail.com>
Thu, 20 Oct 2016 05:58:55 +0000 (07:58 +0200)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 Nov 2016 16:20:50 +0000 (11:20 -0500)
lttng-relayd man pages states that the option
-V --version is available, but it it's missing in the code

Signed-off-by: Anders Wallin <wallinux@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/main.c

index ea46ec72276117359b32fa499b584357b5aeb401..9c0e2b1e37158d728ace4bae91a21a70d9d80a93 100644 (file)
@@ -161,10 +161,11 @@ static struct option long_options[] = {
        { "output", 1, 0, 'o', },
        { "verbose", 0, 0, 'v', },
        { "config", 1, 0, 'f' },
+       { "version", 0, 0, 'V' },
        { NULL, 0, 0, 0, },
 };
 
-static const char *config_ignore_options[] = { "help", "config" };
+static const char *config_ignore_options[] = { "help", "config", "version" };
 
 /*
  * Take an option from the getopt output and set it in the right variable to be
@@ -255,6 +256,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                        perror("exec");
                }
                exit(EXIT_FAILURE);
+       case 'V':
+               fprintf(stdout, "%s\n", VERSION);
+               exit(EXIT_SUCCESS);
        case 'o':
                if (lttng_is_setuid_setgid()) {
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
This page took 0.027246 seconds and 4 git commands to generate.