mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-10-02 08:51:18 +02:00
18269: improve sccs file completion to handle both direct & indirect references
This commit is contained in:
parent
945f54b001
commit
4e6c75fa78
@ -1,3 +1,8 @@
|
||||
2003-02-21 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 18269: Completion/Unix/Command/_sccs: improve file completion
|
||||
to handle both direct and indirect references to s. files
|
||||
|
||||
2003-02-20 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 18263: Src/glob.c: fix saving of glob state so that globs can
|
||||
|
@ -2,10 +2,17 @@
|
||||
|
||||
(( $+functions[_sccs_files] )) ||
|
||||
_sccs_files() {
|
||||
local dir=${PROJECTDIR:-~+}/${PREFIX##*/}/$finalpath
|
||||
local dir expl ret=1 pref=$PREFIX ipref=$IPREFIX
|
||||
dir="${(M)PREFIX##*/}$finalpath"
|
||||
[[ $~dir = (.|..|)/* ]] || dir="${PROJECTDIR:-~+}/$dir"
|
||||
compset -P "*/"
|
||||
_wanted file expl file compadd "$@" - $~dir/*(N.:t:s/s.//) && ret=0
|
||||
PREFIX="$pref"
|
||||
IPREFIX="$ipref"
|
||||
_wanted sccs-files expl 'sccs file' _files -W ${PROJECTDIR:-~+} \
|
||||
-g 's.*' && ret=0
|
||||
|
||||
compset -P '*/'
|
||||
_files -W $dir -g \*\(:s/s.//\) "$@"
|
||||
return ret
|
||||
}
|
||||
|
||||
local curcontext="$curcontext" state line
|
||||
@ -20,7 +27,7 @@ subcmds=(
|
||||
|
||||
ropt='-r+[specify sccs delta id]:sccs delta id'
|
||||
copt='-c+[specify date]:date-stamp'
|
||||
sfiles=':file:_sccs_files'
|
||||
sfiles=":file:_files -g s.\*"
|
||||
|
||||
if [[ $service = sccs ]]; then
|
||||
_arguments -C -A "-*" \
|
||||
@ -34,6 +41,7 @@ if [[ $service = sccs ]]; then
|
||||
return
|
||||
fi
|
||||
service="$words[1]"
|
||||
sfiles=':file:_sccs_files'
|
||||
curcontext="${curcontext%:*}-$service:"
|
||||
fi
|
||||
finalpath="${opt_args[-p]:-SCCS}"
|
||||
|
Loading…
Reference in New Issue
Block a user