]> sigrok.org Git - sigrok-cli.git/commitdiff
List dummy "sigrok" file format, and accept it as option
authorBert Vermeulen <redacted>
Thu, 5 Sep 2013 22:30:38 +0000 (00:30 +0200)
committerBert Vermeulen <redacted>
Thu, 5 Sep 2013 22:31:19 +0000 (00:31 +0200)
See bug 131

sigrok-cli.c

index 0daf79ee33c9dc88e209c8266b9406ba04fedd0f..71c35b78d359c83e118fc8b7b72635f59d6da668 100644 (file)
@@ -252,6 +252,7 @@ static void show_version(void)
        outputs = sr_output_list();
        for (i = 0; outputs[i]; i++)
                printf("  %-20s %s\n", outputs[i]->id, outputs[i]->description);
+       printf("  %-20s %s\n", "sigrok", "Default file output format");
        printf("\n");
 
 #ifdef HAVE_SRD
@@ -1268,6 +1269,13 @@ int setup_output_format(void)
        int i;
        char *fmtspec;
 
+       if (opt_output_format && !strcmp(opt_output_format, "sigrok")) {
+               /* Doesn't really exist as an output module - this is
+                * the session save mode. */
+               g_free(opt_output_format);
+               opt_output_format = NULL;
+       }
+
        if (!opt_output_format) {
                opt_output_format = DEFAULT_OUTPUT_FORMAT;
                /* we'll need to remember this so when saving to a file