When fail when a command parser command is not in list then fail.

Previously it returned the last in the list.
This commit is contained in:
Charles Brej 2008-11-21 16:58:25 +00:00
parent 9435d6cc22
commit a2369d8e89

View file

@ -427,12 +427,12 @@ ply_command_parser_get_command (ply_command_parser_t *parser,
next_node = ply_list_get_next_node (parser->available_subcommands, node);
if (strcmp (command_name, command->name) == 0)
break;
return command;
node = next_node;
}
return command;
return NULL;
}
static void
@ -858,7 +858,7 @@ on_show_splash (ply_command_parser_t *parser,
plugin_name = NULL;
ply_command_parser_get_command_options (parser, command, "plugin-name", &plugin_name, NULL);
printf ("show splash plugin '%s'", plugin_name);
printf ("show splash plugin '%s'\n", plugin_name);
free (plugin_name);
}