From: Frank Stettner Date: Sun, 15 Aug 2021 16:30:03 +0000 (+0200) Subject: show: Format channel output when no channel is available X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7ce834c1166fcf57ebb0e20bf4e7ba9e856aa6ce;p=sigrok-cli.git show: Format channel output when no channel is available --- diff --git a/show.c b/show.c index 9ce35b4..5243e53 100644 --- a/show.c +++ b/show.c @@ -465,8 +465,11 @@ void show_dev_detail(void) printf("Channel groups:\n"); for (cgl = channel_groups; cgl; cgl = cgl->next) { cg = cgl->data; - printf(" %s: channel%s", cg->name, - g_slist_length(cg->channels) > 1 ? "s" : ""); + printf(" %s: ", cg->name); + if (g_slist_length(cg->channels) == 0) + printf("No channels"); + else + printf("channel%s", g_slist_length(cg->channels) > 1 ? "s" : ""); for (chl = cg->channels; chl; chl = chl->next) { ch = chl->data; printf(" %s", ch->name);