From: Bert Vermeulen Date: Thu, 13 Mar 2014 18:31:28 +0000 (+0100) Subject: decode: Show possible values for decoder options. X-Git-Tag: sigrok-cli-0.5.0~23 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f2e8273289ec855bb35a5a78ed49d1f1c761be94;p=sigrok-cli.git decode: Show possible values for decoder options. --- diff --git a/show.c b/show.c index 0e865f8..2eaa69d 100644 --- a/show.c +++ b/show.c @@ -494,7 +494,7 @@ void show_dev_detail(void) #ifdef HAVE_SRD void show_pd_detail(void) { - GSList *l, *ll; + GSList *l, *ll, *ol; struct srd_decoder *dec; struct srd_decoder_option *o; char **pdtokens, **pdtok, *optsep, **ann, *val, *doc; @@ -558,9 +558,14 @@ void show_pd_detail(void) if (dec->options) { for (l = dec->options; l; l = l->next) { o = l->data; + printf("- %s: %s (", o->id, o->desc); + for (ol = o->values; ol; ol = ol->next) { + val = g_variant_print(ol->data, FALSE); + printf("%s, ", val); + g_free(val); + } val = g_variant_print(o->def, FALSE); - printf("- %s: %s (default %s)\n", o->id, - o->desc, val); + printf("default %s)\n", val); g_free(val); } } else {