X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=main.c;h=02f69a2ebbb5d998bf609844b01c488a525c613b;hb=eaa5c96667ae1498b184052665f4b547ab47d432;hp=829492f5704aa8b3b0f4d5f2a1c48a1d4b61709a;hpb=56fc0d6dbca2d46ff2a79275ef6307c4e38bf6a1;p=sigrok-cli.git diff --git a/main.c b/main.c index 829492f..02f69a2 100644 --- a/main.c +++ b/main.c @@ -136,7 +136,7 @@ static void get_option(void) return; } - cg = select_channel_group(sdi); + cg = lookup_channel_group(sdi); if (!(ci = sr_key_info_name_get(SR_KEY_CONFIG, opt_get))) g_critical("Unknown option '%s'", opt_get); @@ -224,6 +224,11 @@ int main(int argc, char **argv) goto done; #ifdef HAVE_SRD + if (opt_pd_binary && !opt_pds) { + g_critical("Option -B will not take effect in the absence of -P."); + goto done; + } + /* Set the loglevel (amount of messages to output) for libsigrokdecode. */ if (srd_log_loglevel_set(opt_loglevel) != SRD_OK) goto done; @@ -242,6 +247,8 @@ int main(int argc, char **argv) if (opt_pd_binary) { if (setup_pd_binary(opt_pd_binary) != 0) goto done; + if (setup_binary_stdout() != 0) + goto done; if (srd_pd_output_callback_add(srd_sess, SRD_OUTPUT_BINARY, show_pd_binary, NULL) != SRD_OK) goto done; @@ -259,6 +266,7 @@ int main(int argc, char **argv) show_pd_annotations, NULL) != SRD_OK) goto done; } + show_pd_prepare(); } #endif @@ -298,6 +306,8 @@ int main(int argc, char **argv) show_help(); #ifdef HAVE_SRD + if (opt_pds) + show_pd_close(); if (opt_pds) srd_exit(); #endif