X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fload.c;h=002ec4958945ae2bc7caf9eb3c86537243290a84;hp=0516351ea8ddaddfbe4fdfb312c6f986d16ef6c7;hb=ab5be9fa2eb5ba9600a82cd18fd3cfcbac69169a;hpb=060e2e097f4125fdde16ed6919535f75696f9c7b diff --git a/src/bin/lttng/commands/load.c b/src/bin/lttng/commands/load.c index 0516351ea..002ec4958 100644 --- a/src/bin/lttng/commands/load.c +++ b/src/bin/lttng/commands/load.c @@ -1,18 +1,8 @@ /* - * Copyright (C) 2014 - Jérémie Galarneau + * Copyright (C) 2014 Jérémie Galarneau * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2 only, - * as published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define _LGPL_SOURCE @@ -37,6 +27,12 @@ static int opt_load_all; static const char *session_name; +#ifdef LTTNG_EMBED_HELP +static const char help_msg[] = +#include +; +#endif + enum { OPT_HELP = 1, OPT_ALL, @@ -157,6 +153,7 @@ int cmd_load(int argc, const char **argv) poptContext pc; struct lttng_load_session_attr *session_attr = NULL; char *input_path = NULL; + const char *leftover = NULL; pc = poptGetContext(NULL, argc, argv, load_opts, 0); poptReadDefaultConfig(pc, 0); @@ -200,6 +197,13 @@ int cmd_load(int argc, const char **argv) } } + leftover = poptGetArg(pc); + if (leftover) { + ERR("Unknown argument: %s", leftover); + ret = CMD_ERROR; + goto end; + } + /* Mi check */ if (lttng_opt_mi) { writer = mi_lttng_writer_create(fileno(stdout), lttng_opt_mi);