Add yum repolist, --enable/disablerepo, and --disableexcludes completions.
This commit is contained in:
parent
ab46b349a4
commit
23e1851605
21
contrib/yum
21
contrib/yum
@ -19,6 +19,15 @@ _yum_list()
|
|||||||
fi
|
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()
|
_yum()
|
||||||
{
|
{
|
||||||
local cur prev special
|
local cur prev special
|
||||||
@ -72,6 +81,9 @@ _yum()
|
|||||||
clean)
|
clean)
|
||||||
COMPREPLY=( $( compgen -W 'packages headers metadata cache dbcache all' -- $cur ) )
|
COMPREPLY=( $( compgen -W 'packages headers metadata cache dbcache all' -- $cur ) )
|
||||||
;;
|
;;
|
||||||
|
repolist)
|
||||||
|
COMPREPLY=( $( compgen -W 'all enabled disabled' -- $cur ) )
|
||||||
|
;;
|
||||||
localinstall|localupdate)
|
localinstall|localupdate)
|
||||||
# TODO: should not match *src.rpm
|
# TODO: should not match *src.rpm
|
||||||
_filedir rpm
|
_filedir rpm
|
||||||
@ -82,6 +94,15 @@ _yum()
|
|||||||
--installroot)
|
--installroot)
|
||||||
_filedir -d
|
_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 \
|
COMPREPLY=( $( compgen -W 'install update check-update \
|
||||||
upgrade remove erase list info provides whatprovides \
|
upgrade remove erase list info provides whatprovides \
|
||||||
|
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -7,6 +7,7 @@ bash-completion (1:1.x) UNRELEASED; urgency=low
|
|||||||
* Split yum and yum-arch completion into contrib/yum.
|
* Split yum and yum-arch completion into contrib/yum.
|
||||||
* Install yum-arch completion only if yum-arch is installed.
|
* Install yum-arch completion only if yum-arch is installed.
|
||||||
* Update list of yum commands and options.
|
* 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
|
-- David Paleino <d.paleino@gmail.com> Wed, 25 Mar 2009 23:18:24 +0100
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user