From: Uwe Hermann Date: Sat, 7 Jan 2012 13:46:24 +0000 (+0100) Subject: cli: Better debug messages for setting PD probes. X-Git-Tag: sigrok-cli-0.3.0~75 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5aa4e6d953e419f304a7e863ec4a5660e91bd63b;p=sigrok-cli.git cli: Better debug messages for setting PD probes. --- diff --git a/sigrok-cli.c b/sigrok-cli.c index 2856bc9..86fc685 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -461,9 +461,15 @@ static int register_pds(struct sr_device *device, const char *pdstring) for (optok = optokens+1; *optok; optok++) { char probe[strlen(*optok)]; int num; - if(sscanf(*optok, "%[^=]=%d", probe, &num) == 2) + if (sscanf(*optok, "%[^=]=%d", probe, &num) == 2) { + printf("Setting probe '%s' to %d\n", probe, num); srd_instance_set_probe(di, probe, num); - /* TODO: else fail somehow */ + } else { + fprintf(stderr, "Error: Couldn't parse decoder " + "options correctly! Aborting.\n"); + /* FIXME: Better error handling. */ + exit(EXIT_FAILURE); + } } g_strfreev(optokens);