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 Wed, Jun 2, 2021 at 1:58 PM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
>
> And here's another part of workers 48926 as a separate patch.

run-help:115: parse error near `]'

Typo?
+                shift -p (( $#cmd_args + 1 - cmd_args[(i)(-|--|;)] )) cmd_args

This change also breaks the run-help-ssh example in the documentation,
and does so in a way I think it's impossible to fix.

Stupid example, but:

% ssh -- localhost date

Without the patch, run-help displays help for the "date" command.
With it, help for "ssh".

It would not surprise me to find that attempting to generically parse
arguments in run-help would also break helpers for commands like "su"
and "sudo",  some commands that have git-style sub-commands, or .




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