[Toybox] Options and help

Elie De Brauwer eliedebrauwer at gmail.com
Wed Aug 15 04:46:17 PDT 2012


Hello list,

Something I noted, probably it's already known, but just wanted to raise 
this. When commands have functionality hidden behind options (e.g. 
sleep.c has SLEEP_FLOAT and sort has SORT_BIG or SORT_FLOAT) it is 
apparently possible to have the command parser cope with these options 
(see sort.c for an example), but this doesn't work for the help string. 
Help will only display the string matching USE_XXX, which as with 
command line parsing certain flags should be optional.

So while a make defconfig gives you all options enabled for sleep and 
sort, the help will only display the minimalistic version:

edb at lapedb:~/edb-stuff/toybox/toybox$ ./toybox help sleep
usage: sleep SECONDS

Wait before exiting.
edb at lapedb:~/edb-stuff/toybox/toybox$ ./toybox help sort
usage: sort [-run] [FILE...]

Sort all lines of text from input files (or stdin) to stdout.

-r    reverse
-u    unique lines only
-n    numeric order (instead of alphabetical)

my 2 cents
E.
-- 
Elie De Brauwer


 1345031177.0


More information about the Toybox mailing list