On Sat, Jul 12, 2008 at 07:19:56PM +0200, Denys Vlasenko wrote:
>>From: Joey Hess <[EMAIL PROTECTED]>
>>My version:
>>TAB=" "
>>busybox --help | grep -A 100 'Currently defined functions' | \
>> tail -n +2 | grep "^$TAB" | sed 's/,/ /g'
>>> Currently to get a list of the supported commands in busybox I need to use
>>> the above shell code. This is ugly and will cause problems if the number of
>>> lines required changes.
>>>
>>> What we need is a --list command-line option that will display all supported
>>> options one per line to stdout without any additional commentary.
>>
>>Seconded.
>
>I feel I'm not too crazy about code size, so I'm trying to imagine
>how the founders of the project might think. And I think they
>wouldn't like this.
>
>If one line of shell script can do it:
>
>busybox | grep -A 100 'Currently defined functions' | { read junk; xargs | sed
>-e 's/,/ /g' -e 's/ */ /g'; }
or, for people with /usr/bin/awk as their default command-line interpreter:
./busybox 2>&1 | awk
'{if(/^Curr/){i=1;};if(((i>0)&&(!/^Currently/))&&(!/^$/)){print}}'
or various variants of a more fancy final 'print'.
>(this version doesnt require TAB tricks, it's all plain ASCII)
>
>then busybox don't need it. We are supposed to be -Os minded people,
>and we should be resisting adding more switches just because
>it's vaguely useful.
agree 100%.
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox