Add --enable-embedded-help option to embed --help messages in binaries
[lttng-tools.git] / src / bin / lttng / command.h
index b5c968d39c2b2cdf210d5c2b32830d6706cc90b7..bda6ef937d3b4c4ce0498fce49b771e52ddec45c 100644 (file)
 #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)
This page took 0.02336 seconds and 4 git commands to generate.