diff --git a/contrib/yum b/contrib/yum index 55433160..b78525fb 100644 --- a/contrib/yum +++ b/contrib/yum @@ -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 \ diff --git a/debian/changelog b/debian/changelog index 0afbdccb..6524529e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 25 Mar 2009 23:18:24 +0100