From 4e6c75fa78552ae54bad3e0fa6eebc57bb0177d3 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 21 Feb 2003 11:01:19 +0000 Subject: 18269: improve sccs file completion to handle both direct & indirect references --- ChangeLog | 7 ++++++- Completion/Unix/Command/_sccs | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index afa54b3cc..5181e859c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2003-02-20 Oliver Kiddle +2003-02-21 Oliver Kiddle + + * 18269: Completion/Unix/Command/_sccs: improve file completion + to handle both direct and indirect references to s. files + +2003-02-20 Oliver Kiddle * 18263: Src/glob.c: fix saving of glob state so that globs can be used from the (e) glob qualifier diff --git a/Completion/Unix/Command/_sccs b/Completion/Unix/Command/_sccs index e4af91a97..ed0dd516d 100644 --- a/Completion/Unix/Command/_sccs +++ b/Completion/Unix/Command/_sccs @@ -2,10 +2,17 @@ (( $+functions[_sccs_files] )) || _sccs_files() { - local dir=${PROJECTDIR:-~+}/${PREFIX##*/}/$finalpath - - compset -P '*/' - _files -W $dir -g \*\(:s/s.//\) "$@" + 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 + + 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}" -- cgit 1.4.1