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

Re: run-help's man arguments



On Jun 6, 12:52pm, Jun T. wrote:
} Subject: Re: run-help's man arguments
}
} I'm not familiar with zsh internals, but I think ESC-h (in the default  
} bindings) is bound to the ZLE widget 'run-help' which calls the  
} function "run-help" as "run-help $1".

You have a point there.  PWS, how did you manage to get run-help to
pass the entire locate command line to "man $@:t"?

The only time the whole command line is obtained is when there's a
function or alias named (in this example) "run-help-locate".

The only OTHER time multiple arguments are in $@ is when $1 is quoted
so the command is re-applied to ${(Q)1}, but in that case $@ is the
output from "whence", not the original command line.

} So "man $@:t" in the function is equivalent to "man $1:t" if called
} from the widget.

True except in the second of those latter two cases.
 
} I believe most people use the run-help function via key binding, but  
} there is a possibility that someone use it by explicitly typing it. Or  
} by "alias m=run-help" and "m history", "m 3 printf" etc.

That's the sort of "against the spirit" and "well-hidden" behavior to
which PWS referred.  Also note that "m 3 printf" will produce a bunch
of errors about not finding "3" before it gets around to running "man",
so it's not a particularly good use of run-help.



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