[Toybox] Allow --help after other arguments?

Ryan Prichard rprichard at google.com
Wed Jun 9 19:00:25 PDT 2021


It seems to have broken --help when invoking toybox explicitly:

$ ./toybox ls --help
<shows same output as "./toybox --help" rather than the "toybox ls" usage.>

Are we concerned about interpreting "data" arguments as the --help flag?
e.g.:

$ ./rm -- --help
<prints usage rather than remove the file named "--help">

$ ./tar -c README > --help && tar -tvf --help
-rw-r----- rprichard/primarygroup 6306 2021-06-08 19:10 README

$ ./tar -c README > --help && ./tar -tvf --help
<prints "toybox tar" usage with the new --help behavior. previously toybox
behaved like GNU tar above.>

On Wed, Jun 9, 2021 at 4:46 PM Rob Landley <rob at landley.net> wrote:

> On 6/8/21 9:11 PM, Ryan Prichard via Toybox wrote:
> > $ ls -l --help
> > ls: Unknown option 'help' (see "ls --help")
> >
> > I tend to add `--help` to the end of a command line that I'm
> constructing, so I
> > was surprised by toybox's requirement that `--help` be first. Maybe
> toybox
> > should be more accommodating?
> >
> > Maybe it'd matter more with an alias, e.g.:
> >
> > $ alias ls='ls --color=auto'
>
> >
> > $ ls --help
> > ls: Unknown option 'help' (see "ls --help")
>
> Hmmm, you've got a point.
>
> Try now?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210609/4d7cc4e2/attachment.html>


More information about the Toybox mailing list