Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Let run-help filter cmd_args before calling run-help-<command> (was Re: [RFC][PATCH] Try calling command with help flags in run-help)

On Thu, Jun 3, 2021 at 2:27 PM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> On Thu, Jun 3, 2021 at 7:34 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > Stupid example, but:
> >
> > % ssh -- localhost date
> >
> > Without the patch, run-help displays help for the "date" command.
> > With it, help for "ssh".
> That's weird. For me, it gets help for 'ssh', both before and after
> the patch (on commit bd328a2).

As mentioned elsewhere, you do have to manually load run-help-ssh into
your test shell, it is not an autoloadable file.

> My patch actually fixes an annoying case with 'run-help git'. Try
> pressing ^[h on, for example, 'git -C /path/to/zsh log'.

This works for me, with or without your patch, using the git
completion in the current repository head.  Are you sure you're
loading functions from the right path?

> Anyway, here's a new version of my patch. Let me know what you think.

I don't see any obvious problems with it but I don't know how to
construct a test case for any of the helpers you've edited.  It would
be nice to know that this does not break the un-edited versions of
those helpers, because if those changes are required rather than just
redundant code removal, other helpers in the wild would also require

Messages sorted by: Reverse Date, Date, Thread, Author