Apply upstream indentation settings.

This commit is contained in:
Ville Skyttä 2009-03-14 21:09:35 +00:00
parent 23bfeb08a0
commit 46dfbbd339
2 changed files with 73 additions and 65 deletions

View File

@ -1,69 +1,73 @@
# bash completion for mock -*- sh -*- # -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
# ex: ts=8 sw=8 noet filetype=sh
#
# bash completion for mock
# TODO: --copyin, --copyout # TODO: --copyin, --copyout
_mock() _mock()
{ {
local cur prev plugins cfgdir local cur prev plugins cfgdir
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]} prev=${COMP_WORDS[COMP_CWORD-1]}
plugins='ccache yum_cache root_cache bind_mount' plugins='ccache yum_cache root_cache bind_mount'
cfgdir=/etc/mock cfgdir=/etc/mock
count=0 count=0
for i in "${COMP_WORDS[@]}" ; do for i in "${COMP_WORDS[@]}" ; do
[ $count -eq $COMP_CWORD ] && break [ $count -eq $COMP_CWORD ] && break
if [[ "$i" == --configdir ]] ; then if [[ "$i" == --configdir ]] ; then
cfgdir="${COMP_WORDS[((count+1))]}" cfgdir="${COMP_WORDS[((count+1))]}"
elif [[ "$i" == --configdir=* ]] ; then elif [[ "$i" == --configdir=* ]] ; then
cfgdir=${i/*=/} cfgdir=${i/*=/}
fi fi
count=$((++count)) count=$((++count))
done done
case $prev in case $prev in
-@(-root|r)) -@(-root|r))
COMPREPLY=( $( command ls $cfgdir | \ COMPREPLY=( $( command ls $cfgdir | \
sed -ne 's/^\('$cur'.*\)\.cfg$/\1/p') ) sed -ne 's/^\('$cur'.*\)\.cfg$/\1/p') )
return 0 return 0
;; ;;
-@(-help|h)) -@(-help|h))
return 0 return 0
;; ;;
esac esac
# --name=value style option # --name=value style option
if [[ "$cur" == *=* ]] ; then if [[ "$cur" == *=* ]] ; then
prev=${cur/=*/} prev=${cur/=*/}
cur=${cur/*=/} cur=${cur/*=/}
case $prev in case $prev in
--@(config|result)dir) --@(config|result)dir)
_filedir -d _filedir -d
return 0 return 0
;; ;;
--@(en|dis)able-plugin) --@(en|dis)able-plugin)
COMPREPLY=( $( compgen -W "$plugins" -- $cur ) ) COMPREPLY=( $( compgen -W "$plugins" -- $cur ) )
return 0 return 0
;; ;;
--@(arch|target|define|with|without|uniqueext|rpmbuild_timeout|cwd)) --@(arch|target|define|with|without|uniqueext|rpmbuild_timeout|cwd))
return 0 return 0
;; ;;
esac esac
fi fi
if [[ "$cur" == -* ]] ; then if [[ "$cur" == -* ]] ; then
COMPREPLY=( $( compgen -W '--version -h --help --rebuild --shell \ COMPREPLY=( $( compgen -W '--version -h --help --rebuild \
--chroot --clean --init --installdeps --install --update \ --shell --chroot --clean --init --installdeps \
--orphanskill -r --root= --offline --no-clean --cleanup-after \ --install --update --orphanskill -r --root= --offline \
--no-cleanup-after --arch= --target= -D --define= --with= \ --no-clean --cleanup-after --no-cleanup-after --arch= \
--without= --resultdir= --uniqueext= --configdir= \ --target= -D --define= --with= --without= \
--rpmbuild_timeout --unpriv --cwd= -v --verbose -q --quiet \ --resultdir= --uniqueext= --configdir= \
--trace --enable-plugin= --disable-plugin= --print-root-path' \ --rpmbuild_timeout --unpriv --cwd= -v --verbose -q \
-- $cur ) ) --quiet --trace --enable-plugin= --disable-plugin= \
else --print-root-path' -- $cur ) )
_filedir '?(no)src.rpm' else
fi _filedir '?(no)src.rpm'
fi
} }
complete -F _mock $filenames mock complete -F _mock $filenames mock

View File

@ -1,16 +1,20 @@
# bash completion for plague-client -*- sh -*- # -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
# ex: ts=8 sw=8 noet filetype=sh
# bash completion for plague-client
_plague_client() _plague_client()
{ {
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` cur=`_get_cword`
[ $COMP_CWORD = 1 ] && \ [ $COMP_CWORD = 1 ] && \
COMPREPLY=( $( compgen -W 'build detail finish help is_paused kill list \ COMPREPLY=( $( compgen -W 'build detail finish help is_paused \
list_builders pause requeue unpause update_builders' -- $cur ) ) kill list list_builders pause requeue unpause \
update_builders' -- $cur ) )
return 0 return 0
} }
complete -F _plague_client plague-client complete -F _plague_client plague-client