From 371d58b88f32704231fe0fd884f63dcbc81507ea Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Thu, 27 Jan 2011 23:14:44 -0600 Subject: [PATCH] alsaucm: fix list command and output add one argument to list to avoid error message, do not list comments as verbs Signed-off-by: Pierre-Louis Bossart Signed-off-by: Jaroslav Kysela --- alsaucm/usecase.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/alsaucm/usecase.c b/alsaucm/usecase.c index bb894c6..1ac1fbc 100644 --- a/alsaucm/usecase.c +++ b/alsaucm/usecase.c @@ -85,7 +85,7 @@ static struct cmd cmds[] = { { OM_RESET, 0, 1, "reset" }, { OM_RELOAD, 0, 1, "reload" }, { OM_LISTCARDS, 0, 0, "listcards" }, - { OM_LIST, 0, 1, "list" }, + { OM_LIST, 1, 1, "list" }, { OM_SET, 2, 1, "set" }, { OM_GET, 1, 1, "get" }, { OM_GETI, 1, 1, "geti" }, @@ -232,8 +232,11 @@ static int do_one(struct context *context, struct cmd *cmd, char **argv) } if (err == 0) printf(" list is empty\n"); - for (i = 0; i < err; i++) - printf(" %i: %s\n", i, list[i]); + for (i = 0; i < err / 2; i++) { + printf(" %i: %s\n", i, list[i*2]); + if (list[i*2+1]) + printf(" %s\n", list[i*2+1]); + } snd_use_case_free_list(list, err); break; case OM_SET: