[RFC] redo --help parsing

Bernhard Fischer rep.nop at aon.at
Fri Jun 9 15:04:58 UTC 2006


On Fri, Jun 09, 2006 at 10:11:10AM -0400, Paul Fox wrote:
> > 
> > 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

Hm, you're right. Not sure why i thought it was.o
>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"

If people only wanted to know if a specific applet is present then this
would work, yes.
>From what i heared, folks were using the --help output to loop over it
with `which´ to see where they'd manually place the links to match their
hosts location of the respective applets.




More information about the busybox mailing list