int cmd_help(int argc, const char **argv, const struct cmd_struct commands[])
{
int opt, ret = CMD_SUCCESS;
- char *cmd_name;
+ const char *arg_cmd_name;
static poptContext pc;
const struct cmd_struct *cmd;
int found = 0;
}
/* Get command name */
- cmd_name = (char *) poptGetArg(pc);
-
- if (cmd_name == NULL) {
+ arg_cmd_name = poptGetArg(pc);
+ if (arg_cmd_name == NULL) {
/* Fall back to lttng(1) */
ret = utils_show_help(1, "lttng", lttng_help_msg);
if (ret) {
}
/* Help about help? */
- if (strcmp(cmd_name, "help") == 0) {
+ if (strcmp(arg_cmd_name, "help") == 0) {
SHOW_HELP();
goto end;
}
cmd = &commands[0];
while (cmd->name != NULL) {
- if (strcmp(cmd->name, cmd_name) == 0) {
+ if (strcmp(cmd->name, arg_cmd_name) == 0) {
found = 1;
break;
}
}
if (!found) {
- ERR("Unknown command \"%s\"", cmd_name);
+ ERR("Unknown command \"%s\"", arg_cmd_name);
ret = CMD_ERROR;
goto end;
}