From: Uwe Hermann Date: Wed, 31 May 2017 21:00:39 +0000 (+0200) Subject: show: Also print the possible decoder input/output IDs. X-Git-Tag: sigrok-cli-0.7.0~11 X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=commitdiff_plain;h=2b5d1ae678011075ca0413d36395313f7f001f26 show: Also print the possible decoder input/output IDs. --- diff --git a/show.c b/show.c index f09095a..62a1ac4 100644 --- a/show.c +++ b/show.c @@ -682,7 +682,7 @@ static void show_pd_detail_single(const char *pd) struct srd_decoder_annotation_row *r; GSList *l, *ll, *ol; int idx; - char **pdtokens, **pdtok, *optsep, **ann, **bin, *val, *doc; + char **pdtokens, **pdtok, *optsep, **ann, **bin, *val, *doc, *str; pdtokens = g_strsplit(pd, ",", -1); for (pdtok = pdtokens; *pdtok; pdtok++) { @@ -696,6 +696,24 @@ static void show_pd_detail_single(const char *pd) printf("ID: %s\nName: %s\nLong name: %s\nDescription: %s\n", dec->id, dec->name, dec->longname, dec->desc); printf("License: %s\n", dec->license); + printf("Possible decoder input IDs:\n"); + if (dec->inputs) { + for (l = dec->inputs; l; l = l->next) { + str = l->data; + printf("- %s\n", str); + } + } else { + printf("None.\n"); + } + printf("Possible decoder output IDs:\n"); + if (dec->outputs) { + for (l = dec->outputs; l; l = l->next) { + str = l->data; + printf("- %s\n", str); + } + } else { + printf("None.\n"); + } printf("Annotation classes:\n"); if (dec->annotations) { for (l = dec->annotations; l; l = l->next) {