lttng: show man page when using command's --help
[lttng-tools.git] / src / bin / lttng / utils.c
index 802e0971bd6785c2853e0ffeb1d88b0edc03a5a4..912cbd5775b08bd97485c3dd3768a8ed1a6a8a71 100644 (file)
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <inttypes.h>
+#include <unistd.h>
 
 #include <common/error.h>
 #include <common/utils.h>
+#include <common/defaults.h>
 
 #include "conf.h"
 #include "utils.h"
@@ -479,3 +481,14 @@ void print_session_stats(const char *session_name)
 end:
        return;
 }
+
+int show_cmd_man_page(const char *cmd_name)
+{
+       int ret;
+       char page_name[32];
+
+       ret = sprintf(page_name, "lttng-%s", cmd_name);
+       assert(ret > 0 && ret < 32);
+
+       return utils_show_man_page(1, page_name);
+}
This page took 0.022791 seconds and 4 git commands to generate.