Add --enable-embedded-help option to embed --help messages in binaries
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 9cde946495436f04590339475e96f95b5ea7421c..b856e126fa3fae8c6cc2c3e3d69ae63dd43a84fc 100644 (file)
 
 #define CONSUMERD_FILE "lttng-consumerd"
 
+static const char *help_msg =
+#ifdef LTTNG_EMBED_HELP
+#include <lttng-sessiond.8.h>
+#else
+NULL
+#endif
+;
+
 const char *progname;
 const char *tracing_group_name = DEFAULT_TRACING_GROUP;
 static int tracing_group_name_override;
@@ -4757,9 +4765,9 @@ static int set_option(int opt, const char *arg, const char *optname)
                        tracing_group_name_override = 1;
                }
        } else if (string_match(optname, "help") || opt == 'h') {
-               ret = utils_show_man_page(8, "lttng-sessiond");
+               ret = utils_show_help(8, "lttng-sessiond", help_msg);
                if (ret) {
-                       ERR("Cannot view man page lttng-sessiond(8)");
+                       ERR("Cannot show --help for `lttng-sessiond`");
                        perror("exec");
                }
                exit(ret ? EXIT_FAILURE : EXIT_SUCCESS);
This page took 0.025206 seconds and 5 git commands to generate.