[RFC] redo --help parsing
Paul Fox
pgf at brightstareng.com
Fri Jun 9 07:11:10 PDT 2006
>
> First a quick question.
> IIRC there was demand to be able to emit a list of available applets
> which can be parsed easily).
> Therefor, i'm thinking about adding the possibility to writeout the
> applets by something like
> $ ./busybox --list
> [ [[ false lash ls sh test true
...
> ...Currently doing something like this works, but is not exactly
> elegant:
> ./busybox 2>&1 | awk \
> '{if(/^Curr/){i=3D1;};if(((i>0)&&(!/^Currently/))&&(!/^$/)){print}}'
this works for me:
/bin/busybox | sed -e '1,/^Curr/d' -e '/^$/d' -e 's/,//g'
(i don't know why you say it goes to stderr -- it doesn't. i see
in your message that it's using printf.
i have no objection to what you're proposing, if people really
want it. but i'd imagine what they really want to know is if a
particular applet is present, in which case they'll be filtering
the output anyway, and there's no big difference between this:
busybox | grep -q myapplet && echo "it's there!"
and doing the same thing with "--list"
paul
=---------------------
paul fox, pgf at brightstareng.com
More information about the busybox
mailing list