command: range support for "delete"

This commit is contained in:
Max Kellermann
2009-09-30 23:13:13 +02:00
parent 0478a8e288
commit 31cabc751d
4 changed files with 39 additions and 3 deletions

View File

@@ -632,13 +632,13 @@ handle_addid(struct client *client, int argc, char *argv[])
static enum command_return
handle_delete(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
{
int song;
unsigned start, end;
enum playlist_result result;
if (!check_int(client, &song, argv[1], need_positive))
if (!check_range(client, &start, &end, argv[1], need_range))
return COMMAND_RETURN_ERROR;
result = playlist_delete(&g_playlist, song);
result = playlist_delete_range(&g_playlist, start, end);
return print_playlist_result(client, result);
}