]> sigrok.org Git - sigrok-cli.git/blobdiff - main.c
main: terminate with error when -B was specified but -P is missing
[sigrok-cli.git] / main.c
diff --git a/main.c b/main.c
index aa4f1229888fa91f961cce2d88dd32e1cd93c997..02f69a2ebbb5d998bf609844b01c488a525c613b 100644 (file)
--- 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;