mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
24332, 24333: Improvements to run-help suggested by J.Sommer.
This commit is contained in:
parent
f77eaddddf
commit
66742c6045
6 changed files with 63 additions and 4 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2007-12-31 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* J.Sommer: 24333: Functions/Misc/.distfiles,
|
||||
Functions/Misc/run-help-git, Functions/Misc/run-help-svk,
|
||||
Functions/Misc/run-help-svn: run-help helpers.
|
||||
|
||||
* 24332: Functions/Misc/run-help: use only the path tail of $1
|
||||
when calling "man" et al. Look for a helper function named
|
||||
run-help-$1 to provide specific help for the command, before
|
||||
falling back on "man".
|
||||
|
||||
2007-12-31 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 24330: Completion/X/_xpdf: add some missing options from xpdf
|
||||
|
|
|
@ -1,8 +1,27 @@
|
|||
DISTFILES_SRC='
|
||||
.distfiles
|
||||
add-zsh-hook
|
||||
allopt getjobs mere relative zcalc zmv zargs
|
||||
checkmail harden nslookup run-help zed zrecompile
|
||||
colors is-at-least promptnl tetris zkbd zstyle+
|
||||
allopt
|
||||
checkmail
|
||||
colors
|
||||
getjobs
|
||||
harden
|
||||
is-at-least
|
||||
mere
|
||||
nslookup
|
||||
promptnl
|
||||
relative
|
||||
run-help
|
||||
run-help-git
|
||||
run-help-svk
|
||||
run-help-svn
|
||||
tetris
|
||||
zargs
|
||||
zcalc
|
||||
zed
|
||||
zkbd
|
||||
zmathfuncdef
|
||||
zmv
|
||||
zrecompile
|
||||
zstyle+
|
||||
'
|
||||
|
|
|
@ -85,7 +85,24 @@ do
|
|||
man zshmisc
|
||||
;;
|
||||
(*)
|
||||
((! didman++)) && man $@
|
||||
if ((! didman++))
|
||||
then
|
||||
if whence "run-help-$1:t" >/dev/null
|
||||
then
|
||||
local cmd_args
|
||||
builtin getln cmd_args
|
||||
builtin print -z "$cmd_args"
|
||||
cmd_args=( ${(z)cmd_args} )
|
||||
# Discard environment assignments, etc.
|
||||
while [[ $cmd_args[1] != $1 ]]
|
||||
do
|
||||
shift cmd_args
|
||||
done
|
||||
eval "run-help-$1:t ${(@)cmd_args[2,-1]}"
|
||||
else
|
||||
man $@:t
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if ((i < $#places && ! didman))
|
||||
|
|
10
Functions/Misc/run-help-git
Normal file
10
Functions/Misc/run-help-git
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/zsh
|
||||
if [ $# -eq 0 ]; then
|
||||
man git
|
||||
else
|
||||
local al
|
||||
if al=$(git config --get "alias.$1"); then
|
||||
1=${al%% *}
|
||||
fi
|
||||
man git-$1
|
||||
fi
|
1
Functions/Misc/run-help-svk
Normal file
1
Functions/Misc/run-help-svk
Normal file
|
@ -0,0 +1 @@
|
|||
svk help ${${@:#-*}[1]} | ${=PAGER:-more}
|
1
Functions/Misc/run-help-svn
Normal file
1
Functions/Misc/run-help-svn
Normal file
|
@ -0,0 +1 @@
|
|||
svn help ${${@:#-*}[1]} | ${=PAGER:-more}
|
Loading…
Reference in a new issue