X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommand.h;h=bda6ef937d3b4c4ce0498fce49b771e52ddec45c;hb=9f449915b9d44ce3c9c9255f5d491a62545fee25;hp=b5c968d39c2b2cdf210d5c2b32830d6706cc90b7;hpb=95057847c7adfe3bc351ca61be77848dc91138b7;p=lttng-tools.git 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)