X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Futils.c;h=06df5090ac767307eb37328d418c49b6fc7ca922;hb=4f985cf80e50349be45749fe2d4fc490083d4e63;hp=802e0971bd6785c2853e0ffeb1d88b0edc03a5a4;hpb=20fb9e0220fe6ca9d6fd52e4e3e41b898452a8f1;p=lttng-tools.git diff --git a/src/bin/lttng/utils.c b/src/bin/lttng/utils.c index 802e0971b..06df5090a 100644 --- a/src/bin/lttng/utils.c +++ b/src/bin/lttng/utils.c @@ -26,9 +26,11 @@ #include #include #include +#include #include #include +#include #include "conf.h" #include "utils.h" @@ -479,3 +481,19 @@ void print_session_stats(const char *session_name) end: return; } + +int show_cmd_help(const char *cmd_name, const char *help_msg) +{ + int ret; + char page_name[32]; + + ret = sprintf(page_name, "lttng-%s", cmd_name); + assert(ret > 0 && ret < 32); + ret = utils_show_help(1, page_name, help_msg); + if (ret && !help_msg) { + ERR("Cannot view man page `lttng-%s(1)`", cmd_name); + perror("exec"); + } + + return ret; +}