X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Futils.c;h=893122905bd44ca75b9fa3836cdf9098e142dfff;hp=4d49728c0f47a23cce6eba1bc2f72f11c2c14836;hb=4fc83d948cea6b10484e65f004a6c167e71ac440;hpb=cf0bcb51ea857687a353d2851e572dba6cc63cb0 diff --git a/src/common/utils.c b/src/common/utils.c index 4d49728c0..893122905 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -1429,11 +1429,17 @@ static const char *get_man_bin_path(void) } LTTNG_HIDDEN -int utils_show_man_page(int section, const char *page_name) +int utils_show_help(int section, const char *page_name, + const char *help_msg) { char section_string[8]; const char *man_bin_path = get_man_bin_path(); - int ret; + int ret = 0; + + if (help_msg) { + printf("%s", help_msg); + goto end; + } /* Section integer -> section string */ ret = sprintf(section_string, "%d", section); @@ -1448,5 +1454,7 @@ int utils_show_man_page(int section, const char *page_name) */ ret = execlp(man_bin_path, "man", "-M", MANPATH, section_string, page_name, NULL); + +end: return ret; }