]> sigrok.org Git - sigrok-cli.git/commitdiff
Drop -S stack option
authorKarl Palsson <redacted>
Thu, 24 Nov 2016 12:29:09 +0000 (12:29 +0000)
committerUwe Hermann <redacted>
Mon, 20 Feb 2017 15:30:50 +0000 (16:30 +0100)
The -P option already stacks. The -S option was only used for changing the
stacking order. Simply require the correct order with -P. This reduces
the confusion in stacking.

Signed-off-by: Karl Palsson <redacted>
decode.c
doc/sigrok-cli.1
main.c
options.c
sigrok-cli.h

index 67d8f1ef33c196310bfa24ee1a12f7663e2bbeeb..f71ead00b3284c58c87d0695ff52ac8e7cefe6d4 100644 (file)
--- a/decode.c
+++ b/decode.c
@@ -261,7 +261,7 @@ void map_pd_channels(struct sr_dev_inst *sdi)
        }
 }
 
        }
 }
 
-int setup_pd_stack(char *opt_pds, char *opt_pd_stack, char *opt_pd_annotations)
+int setup_pd_stack(char *opt_pds, char *opt_pd_annotations)
 {
        struct srd_decoder_inst *di_from, *di_to;
        int ret, i;
 {
        struct srd_decoder_inst *di_from, *di_to;
        int ret, i;
@@ -270,17 +270,6 @@ int setup_pd_stack(char *opt_pds, char *opt_pd_stack, char *opt_pd_annotations)
        /* Set up the protocol decoder stack. */
        pds = g_strsplit(opt_pds, ",", 0);
        if (g_strv_length(pds) > 1) {
        /* Set up the protocol decoder stack. */
        pds = g_strsplit(opt_pds, ",", 0);
        if (g_strv_length(pds) > 1) {
-               if (opt_pd_stack) {
-                       /* A stack setup was specified, use that. */
-                       g_strfreev(pds);
-                       pds = g_strsplit(opt_pd_stack, ",", 0);
-                       if (g_strv_length(pds) < 2) {
-                               g_strfreev(pds);
-                               g_critical("Specify at least two protocol decoders to stack.");
-                               return 1;
-                       }
-               }
-
                /* First PD goes at the bottom of the stack. */
                ids = g_strsplit(pds[0], ":", 0);
                if (!(di_from = srd_inst_find_by_id(srd_sess, ids[0]))) {
                /* First PD goes at the bottom of the stack. */
                ids = g_strsplit(pds[0], ":", 0);
                if (!(di_from = srd_inst_find_by_id(srd_sess, ids[0]))) {
index 5e5df36877cc6cd5671a20da170be30e99101336..545b4d5677bd5fbf55a927b45a03b160c1dc998e 100644 (file)
@@ -238,48 +238,6 @@ protocol decoder. Additionally, the user tells sigrok to decode the SPI
 protocol using channel 1 as MISO signal for SPI, channel 5 as MOSI, channel 3
 as CLK, and channel 0 as CS# signal.
 .TP
 protocol using channel 1 as MISO signal for SPI, channel 5 as MOSI, channel 3
 as CLK, and channel 0 as CS# signal.
 .TP
-.BR "\-S, \-\-protocol\-decoder\-stack " <stack>
-This option allows the user to specify a protocol decoder stack, i.e.
-the way in which one protocol decoder's output gets piped into another
-protocol decoder. If not specified, the stack will be set up in the same
-order in which the protocol decoders were given with the
-.B \-\-protocol-decoders
-option.
-.sp
-The decoders are specified by their ID, as shown in the
-.B \-\-version
-output. In addition to the
-.B \-S
-option, all protocol decoders that are used in a stack, must also be specified
-(together with their options, if any) using the
-.B \-P
-parameter.
-.sp
-Example:
-.sp
- $
-.B "sigrok\-cli \-i <file.sr> \-P i2c:sda=4:scl=7,rtc8564"
-.br
-.B "              \-S i2c,rtc8564"
-.sp
-In this example, the
-.B \-S
-option specifies that the output of the
-.BR i2c " decoder"
-is piped into the
-.BR rtc8564 " decoder,"
-i.e., the
-.BR rtc8564 " decoder"
-is stacked on top of the
-.BR i2c " decoder."
-.sp
-The respective protocol decoder options and channel name/number assignments
-must be given using the
-.B \-P
-option (you cannot specify them in the
-.B \-S
-option).
-.TP
 .BR "\-A, \-\-protocol\-decoder\-annotations " <annotations>
 By default, only the stack's topmost protocol decoder's annotation output is
 shown. With this option another decoder's annotation can be selected for
 .BR "\-A, \-\-protocol\-decoder\-annotations " <annotations>
 By default, only the stack's topmost protocol decoder's annotation output is
 shown. With this option another decoder's annotation can be selected for
diff --git a/main.c b/main.c
index 2bb2ef71bb13a95e877a276d346e0e8e41b11264..e699d2f0e6d905b5ab06775c9c65f30bb54c7267 100644 (file)
--- a/main.c
+++ b/main.c
@@ -214,7 +214,7 @@ int main(int argc, char **argv)
                }
                if (register_pds(opt_pds, opt_pd_annotations) != 0)
                        goto done;
                }
                if (register_pds(opt_pds, opt_pd_annotations) != 0)
                        goto done;
-               if (setup_pd_stack(opt_pds, opt_pd_stack, opt_pd_annotations) != 0)
+               if (setup_pd_stack(opt_pds, opt_pd_annotations) != 0)
                        goto done;
 
                /* Only one output type is ever shown. */
                        goto done;
 
                /* Only one output type is ever shown. */
index cba1e630028ff23be5300cb11ae2a4969a5876e6..49a12433618a0b868abfe706d77a0da47fc8a13b 100644 (file)
--- a/options.c
+++ b/options.c
@@ -34,7 +34,6 @@ gchar *opt_channel_group = NULL;
 gchar *opt_triggers = NULL;
 gchar *opt_pds = NULL;
 #ifdef HAVE_SRD
 gchar *opt_triggers = NULL;
 gchar *opt_pds = NULL;
 #ifdef HAVE_SRD
-gchar *opt_pd_stack = NULL;
 gchar *opt_pd_annotations = NULL;
 gchar *opt_pd_meta = NULL;
 gchar *opt_pd_binary = NULL;
 gchar *opt_pd_annotations = NULL;
 gchar *opt_pd_meta = NULL;
 gchar *opt_pd_binary = NULL;
@@ -83,7 +82,6 @@ CHECK_ONCE(opt_channel_group)
 CHECK_ONCE(opt_triggers)
 #ifdef HAVE_SRD
 CHECK_ONCE(opt_pds)
 CHECK_ONCE(opt_triggers)
 #ifdef HAVE_SRD
 CHECK_ONCE(opt_pds)
-CHECK_ONCE(opt_pd_stack)
 CHECK_ONCE(opt_pd_annotations)
 CHECK_ONCE(opt_pd_meta)
 CHECK_ONCE(opt_pd_binary)
 CHECK_ONCE(opt_pd_annotations)
 CHECK_ONCE(opt_pd_meta)
 CHECK_ONCE(opt_pd_binary)
@@ -128,8 +126,6 @@ static const GOptionEntry optargs[] = {
 #ifdef HAVE_SRD
        {"protocol-decoders", 'P', 0, G_OPTION_ARG_CALLBACK, &check_opt_pds,
                        "Protocol decoders to run", NULL},
 #ifdef HAVE_SRD
        {"protocol-decoders", 'P', 0, G_OPTION_ARG_CALLBACK, &check_opt_pds,
                        "Protocol decoders to run", NULL},
-       {"protocol-decoder-stack", 'S', 0, G_OPTION_ARG_CALLBACK, &check_opt_pd_stack,
-                       "Protocol decoder stack", NULL},
        {"protocol-decoder-annotations", 'A', 0, G_OPTION_ARG_CALLBACK, &check_opt_pd_annotations,
                        "Protocol decoder annotation(s) to show", NULL},
        {"protocol-decoder-meta", 'M', 0, G_OPTION_ARG_CALLBACK, &check_opt_pd_meta,
        {"protocol-decoder-annotations", 'A', 0, G_OPTION_ARG_CALLBACK, &check_opt_pd_annotations,
                        "Protocol decoder annotation(s) to show", NULL},
        {"protocol-decoder-meta", 'M', 0, G_OPTION_ARG_CALLBACK, &check_opt_pd_meta,
index 476ee924d5aa2a647828907625dfe069f2deb231..f5260b18bcc83df4c64bf17c287bb5b27e54385e 100644 (file)
@@ -74,7 +74,7 @@ void load_input_file(void);
 /* decode.c */
 #ifdef HAVE_SRD
 int register_pds(const char *opt_pds, char *opt_pd_annotations);
 /* decode.c */
 #ifdef HAVE_SRD
 int register_pds(const char *opt_pds, char *opt_pd_annotations);
-int setup_pd_stack(char *opt_pds, char *opt_pd_stack, char *opt_pd_annotations);
+int setup_pd_stack(char *opt_pds, char *opt_pd_annotations);
 int setup_pd_annotations(char *opt_pd_annotations);
 int setup_pd_meta(char *opt_pd_meta);
 int setup_pd_binary(char *opt_pd_binary);
 int setup_pd_annotations(char *opt_pd_annotations);
 int setup_pd_meta(char *opt_pd_meta);
 int setup_pd_binary(char *opt_pd_binary);
@@ -112,7 +112,6 @@ extern gchar *opt_channel_group;
 extern gchar *opt_triggers;
 extern gchar *opt_pds;
 #ifdef HAVE_SRD
 extern gchar *opt_triggers;
 extern gchar *opt_pds;
 #ifdef HAVE_SRD
-extern gchar *opt_pd_stack;
 extern gchar *opt_pd_annotations;
 extern gchar *opt_pd_meta;
 extern gchar *opt_pd_binary;
 extern gchar *opt_pd_annotations;
 extern gchar *opt_pd_meta;
 extern gchar *opt_pd_binary;