On 02/10/2015 01:50 PM, Bartosz Golaszewski wrote:

> when passing multiple options with the same name to sigrok-cli, only
> the last one in the option string has any effect.
> 
> For example:
> 
>     sigrok-cli --driver=baylibre-acme --config
> probe_power=1=off:probe_power=3=off --set
> 
> only powers off the third probe.
> 
> The reason for this is using a GHashTable in parse_generic_arg() - when a
> key already exists in the hashtable, the corresponding value gets
> overwritten. Is this an intentional behavior? I don't see any hashtable
> look-ups after any call to parse_generic_arg(). Is there any reason why
> it couldn't be changed to a GSList of option structures to allow
> duplicate keys?

More like it's "known" behavior -- we haven't had a really hard case of
needing multiple-value options passed so far. Keep in mind sigrok-cli isn't
the result of much design: when we add features to libsigrok, some way to
use that feature is glommed on to sigrok-cli. If you have a need for this
feature, go ahead and fix it.

Having said that: can't you just disable the probes with the regular channel
enable/disable stuff? This wouldn't need a driver option at all, in that case.


-- 
Bert Vermeulen        b...@biot.com          email/xmpp

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to