/*
- * Copyright (C) 2015 - Julien Desfossez <jdesfossez@efficios.com>
+ * Copyright (C) 2015 Julien Desfossez <jdesfossez@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
static int regenerate_metadata(int argc, const char **argv);
static int regenerate_statedump(int argc, const char **argv);
+#ifdef LTTNG_EMBED_HELP
+static const char help_msg[] =
+#include <lttng-regenerate.1.h>
+;
+#endif
+
enum {
OPT_HELP = 1,
OPT_LIST_OPTIONS,
int ret;
if (argc > 1) {
- ret = -LTTNG_ERR_INVALID;
+ ret = CMD_UNDEFINED;
goto end;
}
ret = lttng_regenerate_metadata(session_name);
if (ret == 0) {
MSG("Metadata successfully regenerated for session %s", session_name);
+ } else {
+ ERR("%s", lttng_strerror(ret));
}
end:
int ret = CMD_SUCCESS, i = 0, argc, command_ret = CMD_SUCCESS;
if (argv == NULL) {
- ERR("argv is null");
+ ERR("No object specified for regenerate command.");
command_ret = CMD_ERROR;
goto end;
}
argc = count_arguments(argv);
+ assert(argc >= 1);
cmd = &actions[i];
while (cmd->func != NULL) {
command_ret = handle_command(poptGetArgs(pc));
if (command_ret) {
- switch (-command_ret) {
- default:
- ERR("%s", lttng_strerror(command_ret));
- success = 0;
- break;
- }
+ success = 0;
}
if (lttng_opt_mi) {