From: Gerhard Sittig Date: Sun, 16 Oct 2016 16:25:30 +0000 (+0200) Subject: show: print binary classes as well in protocol decoder details X-Git-Tag: sigrok-cli-0.7.0~24 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=20917615ac052d1e811066b648438daed00afb67;p=sigrok-cli.git show: print binary classes as well in protocol decoder details The output of `sigrok -P --show` omitted the binary classes, users could not learn which specs are available for the -B option. Add a "Binary classes:" section after the list of annotations. Signed-off-by: Gerhard Sittig --- diff --git a/show.c b/show.c index 54b367c..7d02326 100644 --- a/show.c +++ b/show.c @@ -682,7 +682,7 @@ void show_pd_detail(void) struct srd_decoder_annotation_row *r; GSList *l, *ll, *ol; int idx; - char **pdtokens, **pdtok, *optsep, **ann, *val, *doc; + char **pdtokens, **pdtok, *optsep, **ann, **bin, *val, *doc; pdtokens = g_strsplit(opt_pds, ",", -1); for (pdtok = pdtokens; *pdtok; pdtok++) { @@ -722,6 +722,15 @@ void show_pd_detail(void) } else { printf("None.\n"); } + printf("Binary classes:\n"); + if (dec->binary) { + for (l = dec->binary; l; l = l->next) { + bin = l->data; + printf("- %s: %s\n", bin[0], bin[1]); + } + } else { + printf("None.\n"); + } printf("Required channels:\n"); if (dec->channels) { for (l = dec->channels; l; l = l->next) {