The following commit has been merged in the master branch:
commit 23e1851605a9811a76dfcb118c7a1c1b6ae6a670
Author: Ville Skyttä <[email protected]>
Date:   Mon Mar 30 22:14:20 2009 +0300

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

diff --git a/contrib/yum b/contrib/yum
index 5543316..b78525f 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 0afbdcc..6524529 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 <[email protected]>  Wed, 25 Mar 2009 23:18:24 +0100
 

-- 
bash-completion

_______________________________________________
Bash-completion-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-commits

Reply via email to