[Toybox] --help annoyance

Rob Landley rob at landley.net
Thu Oct 18 11:59:36 PDT 2018


On 10/18/2018 01:12 PM, enh wrote:
> Yeah, my assumption was that as long as I'm still in the flags, --help should
> work. (But not *anywhere*.)

Most commands never _stop_ accepting flags:

  ls file file file -l
  rm file file file -i

lib/args.c has ^ to stop at the first non-option argument, and

$ grep 'TOY(.*\^.*)' toys/*/*.c -l | wc -l
     22
$ grep 'TOY([^^]*)' toys/*/*.c -l | wc -l
    224

About 1/10th of the commands use it. (Hence every command accepting -- and the
old argument about whether echo should.)

> Personally, I often just add --help on the end of what I've already typed if I
> get stuck. 
> 
> For this specific case, I think in my ideal world, a flag that takes arguments
> from a list should probably show that list any time it gets something it doesn't
> understand? But I don't think this is a regression, so I don't think it makes
> sense to try to rush something into this release. 

Weren't you the guy who wanted "see --help" instead of dumping help text all the
time? :)

So far I think I've only got a list dumper in ps. There's stuff like kill -l and
getconf -l that does it too, but that's an option to show the list...

But yeah, accepting --help as well as "help" makes sense...

Rob



More information about the Toybox mailing list