todbot/blink1 — pull request #16 by djnym (2012-12-15 07:24:36+00:00)
Title: Make blink1-tool command line accept options many times

This started as me scratching a few itches. I didn't like that the
random would output non-hex colors, I also didn't like that it left
things on at the end. I also didn't like that you couldn't set the
color before --blink (which I noticed you just added).

So what I did is made it such that most of the command and options
are repeatable and they are run as the command line is parsed.

I only have 2 blink devices but that was enough to test it out.

So for instance, if you have 2 devices and want the first to blink 3
times red, then the second to blink 3 times blue, then both to blink 3
times green you can do

./blink1-tool --id 0 --red --blink 3 \
--id 1 --blue --blink 3 \
--id all --green --blink 3

I made it such that most commands work with whatever devices you
specify. There's still a few issues (in that if I try to close
the devices it segfaults), but thought I'd commit and send a
request for feedback.