mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-22 19:06:31 +01:00
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 <pierre-louis.bossart@intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
8bf9abe97a
commit
371d58b88f
1 changed files with 6 additions and 3 deletions
|
@ -85,7 +85,7 @@ static struct cmd cmds[] = {
|
||||||
{ OM_RESET, 0, 1, "reset" },
|
{ OM_RESET, 0, 1, "reset" },
|
||||||
{ OM_RELOAD, 0, 1, "reload" },
|
{ OM_RELOAD, 0, 1, "reload" },
|
||||||
{ OM_LISTCARDS, 0, 0, "listcards" },
|
{ OM_LISTCARDS, 0, 0, "listcards" },
|
||||||
{ OM_LIST, 0, 1, "list" },
|
{ OM_LIST, 1, 1, "list" },
|
||||||
{ OM_SET, 2, 1, "set" },
|
{ OM_SET, 2, 1, "set" },
|
||||||
{ OM_GET, 1, 1, "get" },
|
{ OM_GET, 1, 1, "get" },
|
||||||
{ OM_GETI, 1, 1, "geti" },
|
{ OM_GETI, 1, 1, "geti" },
|
||||||
|
@ -232,8 +232,11 @@ static int do_one(struct context *context, struct cmd *cmd, char **argv)
|
||||||
}
|
}
|
||||||
if (err == 0)
|
if (err == 0)
|
||||||
printf(" list is empty\n");
|
printf(" list is empty\n");
|
||||||
for (i = 0; i < err; i++)
|
for (i = 0; i < err / 2; i++) {
|
||||||
printf(" %i: %s\n", i, list[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);
|
snd_use_case_free_list(list, err);
|
||||||
break;
|
break;
|
||||||
case OM_SET:
|
case OM_SET:
|
||||||
|
|
Loading…
Reference in a new issue