X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fdisable_channels.c;h=775ff895905b1fc91247b507a2a78a014adec254;hp=01f971f2f9fb2e1db667576c44d9e2f1789aa60b;hb=4fc83d948cea6b10484e65f004a6c167e71ac440;hpb=d125bf20e5061cbf6120d06bd728a097473e3e1c diff --git a/src/bin/lttng/commands/disable_channels.c b/src/bin/lttng/commands/disable_channels.c index 01f971f2f..775ff8959 100644 --- a/src/bin/lttng/commands/disable_channels.c +++ b/src/bin/lttng/commands/disable_channels.c @@ -15,7 +15,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include @@ -35,6 +34,12 @@ static int opt_kernel; static char *opt_session_name; static int opt_userspace; +#ifdef LTTNG_EMBED_HELP +static const char help_msg[] = +#include +; +#endif + enum { OPT_HELP = 1, OPT_USERSPACE, @@ -54,22 +59,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng disable-channel NAME[,NAME2,...] (-k | -u) [OPTIONS]\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Options:\n"); - fprintf(ofp, " -h, --help Show this help\n"); - fprintf(ofp, " --list-options Simple listing of options\n"); - fprintf(ofp, " -s, --session NAME Apply to session name\n"); - fprintf(ofp, " -k, --kernel Apply to the kernel tracer\n"); - fprintf(ofp, " -u, --userspace Apply to the user-space tracer\n"); - fprintf(ofp, "\n"); -} - static int mi_partial_channel_print(char *channel_name, unsigned int enabled, int success) { @@ -234,7 +223,7 @@ int cmd_disable_channels(int argc, const char **argv) while ((opt = poptGetNextOpt(pc)) != -1) { switch (opt) { case OPT_HELP: - usage(stdout); + SHOW_HELP(); goto end; case OPT_USERSPACE: opt_userspace = 1; @@ -243,7 +232,6 @@ int cmd_disable_channels(int argc, const char **argv) list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } @@ -258,7 +246,6 @@ int cmd_disable_channels(int argc, const char **argv) opt_channels = (char*) poptGetArg(pc); if (opt_channels == NULL) { ERR("Missing channel name(s).\n"); - usage(stderr); ret = CMD_ERROR; goto end; }