The output of `sigrok -P <decoder> --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 <gerhard.sit...@gmx.net>
---
 show.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/show.c b/show.c
index 54b367c909a9..7d02326e86ba 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) {
-- 
1.9.1

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to