]> sigrok.org Git - sigrok-cli.git/commitdiff
sr: Rename -f|--format to -O|--output-format.
authorUwe Hermann <redacted>
Sun, 18 Mar 2012 13:33:02 +0000 (14:33 +0100)
committerUwe Hermann <redacted>
Sun, 18 Mar 2012 13:33:02 +0000 (14:33 +0100)
This is done for consistency with the -I|--input-format option. We now have:

-i|--input-file
-o|--output-file
-I|--input-format
-O|--output-format

doc/sigrok-cli.1
sigrok-cli.c

index 7b854a7b261fa35cfaffe024a1b162712e427eda..695979efe13627226a2bbd0f4b01ebbd490fe142 100644 (file)
@@ -2,7 +2,7 @@
 .SH "NAME"
 sigrok\-cli \- Command-line client for the sigrok logic analyzer software
 .SH "SYNOPSIS"
 .SH "NAME"
 sigrok\-cli \- Command-line client for the sigrok logic analyzer software
 .SH "SYNOPSIS"
-.B sigrok\-cli \fR[\fB\-hVDiIodptwaf\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fB\-D\fR|\fB\-\-list\-devices\fR] [\fB\-i\fR|\fB\-\-input\-file\fR filename] [\fB\-I\fR|\fB\-\-input\-format\fR format] [\fB\-o\fR|\fB\-\-output\-file\fR filename] [\fB\-d\fR|\fB\-\-device\fR device] [\fB\-p\fR|\fB\-\-probes\fR probelist] [\fB\-t\fR|\fB\-\-triggers\fR triggerlist] [\fB\-w\fR|\fB\-\-wait\-triggers\fR] [\fB\-a\fR|\fB\-\-protocol\-decoders\fR sequence] [\fB\-f\fR|\fB\-\-format\fR format] [\fB\-\-time\fR ms] [\fB\-\-samples\fR numsamples] [\fB\-\-continuous\fR]
+.B sigrok\-cli \fR[\fB\-hVDiIodptwaf\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fB\-D\fR|\fB\-\-list\-devices\fR] [\fB\-i\fR|\fB\-\-input\-file\fR filename] [\fB\-I\fR|\fB\-\-input\-format\fR format] [\fB\-o\fR|\fB\-\-output\-file\fR filename] [\fB\-d\fR|\fB\-\-device\fR device] [\fB\-p\fR|\fB\-\-probes\fR probelist] [\fB\-t\fR|\fB\-\-triggers\fR triggerlist] [\fB\-w\fR|\fB\-\-wait\-triggers\fR] [\fB\-a\fR|\fB\-\-protocol\-decoders\fR sequence] [\fB\-O\fR|\fB\-\-output-format\fR format] [\fB\-\-time\fR ms] [\fB\-\-samples\fR numsamples] [\fB\-\-continuous\fR]
 .SH "DESCRIPTION"
 .B sigrok\-cli
 is a cross-platform command line utility for the
 .SH "DESCRIPTION"
 .B sigrok\-cli
 is a cross-platform command line utility for the
@@ -43,7 +43,7 @@ sigrok-cli attempts to autodetect the file format of the input file.
 Save output to a file instead of writing it to stdout. The default format
 used when saving is the sigrok session file format. This can be changed with
 the
 Save output to a file instead of writing it to stdout. The default format
 used when saving is the sigrok session file format. This can be changed with
 the
-.B \-\-format
+.B \-\-output\-format
 option, below.
 .TP
 .BR "\-d, \-\-device " <device>
 option, below.
 .TP
 .BR "\-d, \-\-device " <device>
@@ -134,7 +134,7 @@ any pre-trigger data. This option is useful if you don't care about the data
 that came before the trigger (but the logic analyzer hardware delivers this
 data to sigrok nonetheless).
 .TP
 that came before the trigger (but the logic analyzer hardware delivers this
 data to sigrok nonetheless).
 .TP
-.BR "\-f, \-\-format " <formatname>
+.BR "\-O, \-\-output\-format " <formatname>
 Set the output format to use. Use the
 .B \-V
 option to see a list of available output formats. The format name may
 Set the output format to use. Use the
 .B \-V
 option to see a list of available output formats. The format name may
index d5427a785b82e4287799363d09c77be30e07ef7c..fc993b48a76b8d20dd02b3c33c75ce6a321c0c74 100644 (file)
@@ -58,7 +58,7 @@ static gchar *opt_triggers = NULL;
 static gchar *opt_pds = NULL;
 static gchar *opt_pd_stack = NULL;
 static gchar *opt_input_format = NULL;
 static gchar *opt_pds = NULL;
 static gchar *opt_pd_stack = NULL;
 static gchar *opt_input_format = NULL;
-static gchar *opt_format = NULL;
+static gchar *opt_output_format = NULL;
 static gchar *opt_time = NULL;
 static gchar *opt_samples = NULL;
 static gchar *opt_continuous = NULL;
 static gchar *opt_time = NULL;
 static gchar *opt_samples = NULL;
 static gchar *opt_continuous = NULL;
@@ -76,7 +76,7 @@ static GOptionEntry optargs[] = {
        {"protocol-decoders", 'a', 0, G_OPTION_ARG_STRING, &opt_pds, "Protocol decoder sequence", NULL},
        {"protocol-decoder-stack", 's', 0, G_OPTION_ARG_STRING, &opt_pd_stack, "Protocol decoder stack", NULL},
        {"input-format", 'I', 0, G_OPTION_ARG_STRING, &opt_input_format, "Input format", NULL},
        {"protocol-decoders", 'a', 0, G_OPTION_ARG_STRING, &opt_pds, "Protocol decoder sequence", NULL},
        {"protocol-decoder-stack", 's', 0, G_OPTION_ARG_STRING, &opt_pd_stack, "Protocol decoder stack", NULL},
        {"input-format", 'I', 0, G_OPTION_ARG_STRING, &opt_input_format, "Input format", NULL},
-       {"format", 'f', 0, G_OPTION_ARG_STRING, &opt_format, "Output format", NULL},
+       {"output-format", 'O', 0, G_OPTION_ARG_STRING, &opt_output_format, "Output format", NULL},
        {"time", 0, 0, G_OPTION_ARG_STRING, &opt_time, "How long to sample (ms)", NULL},
        {"samples", 0, 0, G_OPTION_ARG_STRING, &opt_samples, "Number of samples to acquire", NULL},
        {"continuous", 0, 0, G_OPTION_ARG_NONE, &opt_continuous, "Sample continuously", NULL},
        {"time", 0, 0, G_OPTION_ARG_STRING, &opt_time, "How long to sample (ms)", NULL},
        {"samples", 0, 0, G_OPTION_ARG_STRING, &opt_samples, "Number of samples to acquire", NULL},
        {"continuous", 0, 0, G_OPTION_ARG_NONE, &opt_continuous, "Sample continuously", NULL},
@@ -351,7 +351,7 @@ static void datafeed_in(struct sr_dev *dev, struct sr_datafeed_packet *packet)
                                }
                        } else {
                                /* saving to a file in whatever format was set
                                }
                        } else {
                                /* saving to a file in whatever format was set
-                                * with --format, so all we need is a filehandle */
+                                * with -O, so all we need is a filehandle */
                                outfile = g_fopen(opt_output_file, "wb");
                        }
                }
                                outfile = g_fopen(opt_output_file, "wb");
                        }
                }
@@ -1052,14 +1052,14 @@ int main(int argc, char **argv)
                g_strfreev(pds);
        }
 
                g_strfreev(pds);
        }
 
-       if (!opt_format) {
-               opt_format = DEFAULT_OUTPUT_FORMAT;
+       if (!opt_output_format) {
+               opt_output_format = DEFAULT_OUTPUT_FORMAT;
                /* we'll need to remember this so when saving to a file
                 * later, sigrok session format will be used.
                 */
                default_output_format = TRUE;
        }
                /* we'll need to remember this so when saving to a file
                 * later, sigrok session format will be used.
                 */
                default_output_format = TRUE;
        }
-       fmtargs = parse_generic_arg(opt_format);
+       fmtargs = parse_generic_arg(opt_output_format);
        fmtspec = g_hash_table_lookup(fmtargs, "sigrok_key");
        if (!fmtspec) {
                printf("Invalid output format.\n");
        fmtspec = g_hash_table_lookup(fmtargs, "sigrok_key");
        if (!fmtspec) {
                printf("Invalid output format.\n");
@@ -1081,7 +1081,7 @@ int main(int argc, char **argv)
                break;
        }
        if (!output_format) {
                break;
        }
        if (!output_format) {
-               printf("invalid output format %s\n", opt_format);
+               printf("invalid output format %s\n", opt_output_format);
                return 1;
        }
 
                return 1;
        }