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

Re: [PATCH 1/4] run-help: Support variables in aliases



On Wed, May 17, 2023 at 3:13 PM Jörg Sommer <joerg@xxxxxxxx> wrote:
>
> If the alias definition starts with a variable assignment, run-help fails,
> because it sees the variable assignment as command. Hence, skip all
> variable assignments and noglob|nocorrect thereafter.

This may not be the right way to handle this.  The same thing is
already being attempted in the block at

    (*)
        if ((! didman++))
        then

where you'll see

                # Discard the command itself & everything before it.

so I would have expected the existing recursive call to cover it.  If
recursion is NOT handling it, then maybe we need to pull that whole
thing up to before the original "whence" command?

Either way, we already have

    (*( is an alias for (noglob|nocorrect))*)

which would be made redundant by your addition of

+            elif [[ $expansion[1] == (noglob|nocorrect) ]]

I repeat my earlier remarks about "reaching the point of diminishing
returns" with our attempts to turn run-help into a full command-line
parser.




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