Add yum repolist, --enable/disablerepo, and --disableexcludes completions.

This commit is contained in:
Ville Skyttä 2009-03-30 22:14:20 +03:00
parent ab46b349a4
commit 23e1851605
2 changed files with 22 additions and 0 deletions

View File

@ -19,6 +19,15 @@ _yum_list()
fi
}
_yum_repolist()
{
# -d 0 causes repolist to output nothing as of yum 3.2.22:
# http://yum.baseurl.org/ticket/83
# Drop first ("repo id repo name") axnd last ("repolist: ...") rows
yum --noplugins -C repolist $1 2>/dev/null | \
sed -ne '/^repo\(\s\+id\|list:\)/d' -e 's/\s.*//p'
}
_yum()
{
local cur prev special
@ -72,6 +81,9 @@ _yum()
clean)
COMPREPLY=( $( compgen -W 'packages headers metadata cache dbcache all' -- $cur ) )
;;
repolist)
COMPREPLY=( $( compgen -W 'all enabled disabled' -- $cur ) )
;;
localinstall|localupdate)
# TODO: should not match *src.rpm
_filedir rpm
@ -82,6 +94,15 @@ _yum()
--installroot)
_filedir -d
;;
--enablerepo)
COMPREPLY=( $( compgen -W '$( _yum_repolist disabled )' -- $cur ) )
;;
--disablerepo)
COMPREPLY=( $( compgen -W '$( _yum_repolist enabled )' -- $cur ) )
;;
--disableexcludes)
COMPREPLY=( $( compgen -W '$( _yum_repolist all ) all main' -- $cur ) )
;;
*)
COMPREPLY=( $( compgen -W 'install update check-update \
upgrade remove erase list info provides whatprovides \

1
debian/changelog vendored
View File

@ -7,6 +7,7 @@ bash-completion (1:1.x) UNRELEASED; urgency=low
* Split yum and yum-arch completion into contrib/yum.
* Install yum-arch completion only if yum-arch is installed.
* Update list of yum commands and options.
* Add yum repolist, --enable/disablerepo, and --disableexcludes completions.
-- David Paleino <d.paleino@gmail.com> Wed, 25 Mar 2009 23:18:24 +0100