X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommand.h;h=bda6ef937d3b4c4ce0498fce49b771e52ddec45c;hp=b5c968d39c2b2cdf210d5c2b32830d6706cc90b7;hb=4fc83d948cea6b10484e65f004a6c167e71ac440;hpb=cf0bcb51ea857687a353d2851e572dba6cc63cb0 diff --git a/src/bin/lttng/command.h b/src/bin/lttng/command.h index b5c968d39..bda6ef937 100644 --- a/src/bin/lttng/command.h +++ b/src/bin/lttng/command.h @@ -28,13 +28,20 @@ #define DECL_COMMAND(_name) \ extern int cmd_##_name(int, const char **) +#ifdef LTTNG_EMBED_HELP +# define HELP_MSG_NAME help_msg +# define SHOW_HELP_ERROR_LINE ERR("Cannot show --help for `lttng-%s`", argv[0]); +#else +# define HELP_MSG_NAME NULL +# define SHOW_HELP_ERROR_LINE ; +#endif + #define SHOW_HELP() \ do { \ - ret = show_cmd_man_page(argv[0]); \ + ret = show_cmd_help(argv[0], HELP_MSG_NAME); \ \ if (ret) { \ - ERR("Cannot view man page lttng-%s(1)", argv[0]); \ - perror("exec"); \ + SHOW_HELP_ERROR_LINE \ ret = CMD_ERROR; \ } \ } while (0)