X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=sigrok-cli.c;h=8521b9546128d17ff2c4f5fa5cae259d7d41d1a8;hp=0daf79ee33c9dc88e209c8266b9406ba04fedd0f;hb=7058a9b8924047b6c3066e80397dcb789e10c9c4;hpb=1e484911c49863a26e6c85f071bced106db8cb5e diff --git a/sigrok-cli.c b/sigrok-cli.c index 0daf79e..8521b95 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -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 @@ -1013,7 +1014,7 @@ static int probes_to_gvar(struct srd_decoder *dec, GHashTable *hash, (GDestroyNotify)g_variant_unref); all_probes = g_slist_copy(dec->probes); - all_probes = g_slist_concat(all_probes, dec->opt_probes); + all_probes = g_slist_concat(all_probes, g_slist_copy(dec->opt_probes)); for (l = all_probes; l; l = l->next) { p = l->data; if (!(val_str = g_hash_table_lookup(hash, p->id))) @@ -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