1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 17:10:59 +01:00

21075: update baz completion to not use -A option since it's being dropped in baz 1.3.

This commit is contained in:
Clint Adams 2005-03-31 13:44:56 +00:00
parent 3933137b3f
commit 6f8b647733
2 changed files with 10 additions and 13 deletions

View file

@ -1,5 +1,8 @@
2005-03-27 Clint Adams <clint@zsh.org> 2005-03-27 Clint Adams <clint@zsh.org>
* 21075: Completion/Unix/Command/_baz: update baz completion
to not use -A option since it's being dropped in baz 1.3.
* Zack Cerza: 21074: Completion/Debian/Command/_aptitude: update * Zack Cerza: 21074: Completion/Debian/Command/_aptitude: update
for newer aptitude. for newer aptitude.

View file

@ -80,7 +80,7 @@ _baz_namespace () { #double as arch_namespace_categories
compset -P '*/' compset -P '*/'
archive=${IPREFIX%/*} archive=${IPREFIX%/*}
_description -V categories expl "${library:-}categories in $archive" _description -V categories expl "${library:-}categories in $archive"
compadd $suffix "$expl[@]" `$BAZ ${library:-}categories -A $archive` compadd $suffix "$expl[@]" `$BAZ ${library:-}categories $archive`
elif [ -z $IPREFIX ]; then elif [ -z $IPREFIX ]; then
local index=$(( words[(i)-A] + 1 )) local index=$(( words[(i)-A] + 1 ))
(( index < CURRENT )) || index=$(( words[(i)--archive] + 1 )) (( index < CURRENT )) || index=$(( words[(i)--archive] + 1 ))
@ -88,7 +88,7 @@ _baz_namespace () { #double as arch_namespace_categories
if [ $archive ]; then if [ $archive ]; then
_description -V categories expl "${library:-}categories in $archive" _description -V categories expl "${library:-}categories in $archive"
compadd "$expl[@]" $suffix `$BAZ ${library:-}categories -A $archive` compadd "$expl[@]" $suffix `$BAZ ${library:-}categories $archive`
fi fi
_baz_archives -S / ${library:+--library} _baz_archives -S / ${library:+--library}
@ -111,7 +111,7 @@ _baz_namespace_branches () {
local category=${IPREFIX%--} local category=${IPREFIX%--}
_description -V branches expl "${library:-}branches" _description -V branches expl "${library:-}branches"
compadd $suffix "$expl[@]" \ compadd $suffix "$expl[@]" \
${${(@)$($BAZ ${library:-}branches -A $archive $category)}##*--} ${${(@)$($BAZ ${library:-}branches $archive/$category)}##*--}
fi fi
if [ $1 -gt 1 ] && [[ $IPREFIX = *-- ]] && [[ $PREFIX = *--* ]]; then if [ $1 -gt 1 ] && [[ $IPREFIX = *-- ]] && [[ $PREFIX = *--* ]]; then
_baz_namespace_versions $(($1 - 1)) _baz_namespace_versions $(($1 - 1))
@ -129,7 +129,7 @@ _baz_namespace_versions () {
local branch=${IPREFIX%--} local branch=${IPREFIX%--}
_description -V versions expl "${library:-}versions" _description -V versions expl "${library:-}versions"
compadd $suffix "$expl[@]" \ compadd $suffix "$expl[@]" \
${${(@)$($BAZ ${library:-}versions -A $archive $branch)}##*--} ${${(@)$($BAZ ${library:-}versions $archive/$branch)}##*--}
fi fi
if [ $1 -gt 1 ] && [[ $IPREFIX = *--*-- ]] && ([[ $IPREFIX = */*--*-- ]] \ if [ $1 -gt 1 ] && [[ $IPREFIX = *--*-- ]] && ([[ $IPREFIX = */*--*-- ]] \
|| [[ $PREFIX != */* ]]) && [[ $PREFIX = *--* ]]; then || [[ $PREFIX != */* ]]) && [[ $PREFIX = *--* ]]; then
@ -146,22 +146,16 @@ _baz_namespace_revisions () {
_description -V revisions expl "${library:-}revisions" _description -V revisions expl "${library:-}revisions"
local completions c local completions c
completions=( completions=(
${${(@)$($BAZ ${library:-}revisions -A $archive $version)}##*--} ${${(@)$($BAZ ${library:-}revisions $archive/$version)}##*--}
) )
(( exclude_library_revisions )) && \ (( exclude_library_revisions )) && \
foreach c ($($BAZ library-revisions -A $archive $version)); do completions[(r)$c]=(); done foreach c ($($BAZ library-revisions $archive/$version)); do completions[(r)$c]=(); done
compadd "$expl[@]" -a completions compadd "$expl[@]" -a completions
fi fi
} }
(( $+functions[_baz_config] )) || (( $+functions[_baz_config] )) ||
_baz_config () { _baz_config () {
# zsh 4.1.1+ is recommended; 4.0.6 gives the error below when doing
# baz build-config e<TAB>
# _path_files:322: no matches found: configs//e/.(/)
# whereas 4.1.1 completes correctly
local configdir root ret=1 n expl local configdir root ret=1 n expl
n=$opt_args[(i)(-d|--dir)] n=$opt_args[(i)(-d|--dir)]
@ -192,7 +186,7 @@ _baz_limit () { #presently only does push-mirror style limits
if [[ $PREFIX != *--* ]]; then if [[ $PREFIX != *--* ]]; then
_description -V categories expl "categories in $archive" _description -V categories expl "categories in $archive"
compadd -q -S -- "$expl[@]" `$BAZ categories -A $archive` compadd -q -S -- "$expl[@]" `$BAZ categories $archive`
else else
_baz_namespace_branches 3 _baz_namespace_branches 3
fi fi