/*
- * Copyright (C) 2014 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (C) 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
- * 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
#include <common/mi-lttng.h>
#include <common/config/session-config.h>
-#include <lttng/load.h>
+#include <lttng/lttng.h>
#include "../command.h"
static const char *session_name;
+#ifdef LTTNG_EMBED_HELP
+static const char help_msg[] =
+#include <lttng-load.1.h>
+;
+#endif
+
enum {
OPT_HELP = 1,
OPT_ALL,
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);
}
}
+ 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);
MSG("Session has been loaded successfully");
}
+ if (opt_override_session_name) {
+ MSG("Session name overridden with %s",
+ opt_override_session_name);
+ }
+
if (opt_override_url) {
MSG("Session output url overridden with %s", opt_override_url);
}