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

Re: run-help: Support for svn and git



Hi,

Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Dec 31, 12:10pm, joerg@xxxxxxxxxxxx wrote:
> } Subject: Re: run-help: Support for svn and git
> } Is it possible to get the point where run-help was called? Maybe for
> } 
> }   ssh -option <1> host cmd <2>
>
> One could replace the run-help widget itself with something that takes
> the line apart with $LBUFFER and $RBUFFER and analyzes it in more
> detail, and if run-help had been invented after user-defined widgets
> were, it would probably never have been designed the way it is.

Isn't it enough to replace the widget by a shell function and register it
with zle?

> Here's a new patch.

Would you apply it to the repository? Here are the functions for svn, svk
and git:

run-help-svn()
{
    svn help ${${@:#-*}[1]} | ${=PAGER:-/usr/bin/pager}
}

run-help-svk()
{
    svk help ${${@:#-*}[1]} | ${=PAGER:-/usr/bin/pager}
}

run-help-git()
{
    if [ $# -eq 0 ]; then
        man git
    else
        local al
        if al=$(git config --get "alias.$1"); then
            1=${al%% *}
        fi
        man git-$1
    fi
}

Bye, Jörg.
-- 
Diskusion „Pascal vs. Rest der Welt“:
30 Aug 2000 00:13:11 GMT, Adrian Knoth <adi@xxxxxxxxxxxxxxxxxxxxx>
Und selbst wenn eure 100000 Zeilen‐Programme noch so oft unter Windows
verwendet werden: mit einem Handwagen fährt man nicht Formel‐1.



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