lttng: show man page when using command's --help
[lttng-tools.git] / src / bin / lttng / commands / version.c
index 4e46d724f10941400be812e7582aa4d60750a869..3630950bbcd0eb63b47f99fd86f2e13318f634d6 100644 (file)
@@ -15,7 +15,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <popt.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -23,7 +23,6 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
-#include <config.h>
 
 #include <common/mi-lttng.h>
 
@@ -149,7 +148,7 @@ int cmd_version(int argc, const char **argv)
        while ((opt = poptGetNextOpt(pc)) != -1) {
                switch (opt) {
                case OPT_HELP:
-                       usage(stdout);
+                       SHOW_HELP();
                        goto end;
                case OPT_LIST_OPTIONS:
                        list_cmd_options(stdout, long_options);
@@ -164,7 +163,8 @@ int cmd_version(int argc, const char **argv)
        if (lttng_opt_mi) {
                ret = print_mi();
        } else {
-               MSG("lttng version " VERSION " - " VERSION_NAME GIT_VERSION_PREFIX GIT_VERSION);
+               MSG("lttng version " VERSION " - " VERSION_NAME "%s",
+                       GIT_VERSION[0] == '\0' ? "" : " - " GIT_VERSION);
                MSG("\n" VERSION_DESCRIPTION "\n");
                MSG("Web site: http://lttng.org");
                MSG("\n%s", lttng_license);
This page took 0.023272 seconds and 4 git commands to generate.