projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: error out on leftover arguments
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
disable_channels.c
diff --git
a/src/bin/lttng/commands/disable_channels.c
b/src/bin/lttng/commands/disable_channels.c
index 678af746d5091181aed4febe926130525afa7c5b..936884e1fc430c79da4ec98b79e24ff8f555fdc3 100644
(file)
--- a/
src/bin/lttng/commands/disable_channels.c
+++ b/
src/bin/lttng/commands/disable_channels.c
@@
-34,6
+34,12
@@
static int opt_kernel;
static char *opt_session_name;
static int opt_userspace;
static char *opt_session_name;
static int opt_userspace;
+#ifdef LTTNG_EMBED_HELP
+static const char help_msg[] =
+#include <lttng-disable-channel.1.h>
+;
+#endif
+
enum {
OPT_HELP = 1,
OPT_USERSPACE,
enum {
OPT_HELP = 1,
OPT_USERSPACE,
@@
-210,6
+216,7
@@
int cmd_disable_channels(int argc, const char **argv)
int opt, ret = CMD_SUCCESS, command_ret = CMD_SUCCESS, success = 1;
static poptContext pc;
char *session_name = NULL;
int opt, ret = CMD_SUCCESS, command_ret = CMD_SUCCESS, success = 1;
static poptContext pc;
char *session_name = NULL;
+ const char *leftover = NULL;
pc = poptGetContext(NULL, argc, argv, long_options, 0);
poptReadDefaultConfig(pc, 0);
pc = poptGetContext(NULL, argc, argv, long_options, 0);
poptReadDefaultConfig(pc, 0);
@@
-244,6
+251,13
@@
int cmd_disable_channels(int argc, const char **argv)
goto end;
}
goto end;
}
+ leftover = poptGetArg(pc);
+ if (leftover) {
+ ERR("Unknown argument: %s", leftover);
+ ret = CMD_ERROR;
+ goto end;
+ }
+
if (!opt_session_name) {
session_name = get_session_name();
if (session_name == NULL) {
if (!opt_session_name) {
session_name = get_session_name();
if (session_name == NULL) {
This page took
0.025159 seconds
and
5
git commands to generate.