Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
static error_t __command_parse(int key, char* arg, struct argp_state* state) {
struct command_ctx* ctx = state->input;
+ const struct command* command = NULL;
+
// Just call the parse function if we don't have any commands
if (!ctx->commands) {
if (!ctx->parse)
// Try to find a command
case ARGP_KEY_ARG:
- const struct command* command = ctx->command = command_find(ctx->commands, arg);
+ command = ctx->command = command_find(ctx->commands, arg);
// Fail if the command wasn't found
if (!command) {