[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 81458b0b9f14404c1f6e5a6b780599471bd5f9d6
Ville Skyttä
ville.skytta at iki.fi
Tue Sep 8 17:21:46 UTC 2009
The following commit has been merged in the master branch:
commit 81458b0b9f14404c1f6e5a6b780599471bd5f9d6
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Tue Sep 8 20:20:48 2009 +0300
Add yum --enable/disableplugin completions.
diff --git a/CHANGES b/CHANGES
index fd10f14..3e50d99 100644
--- a/CHANGES
+++ b/CHANGES
@@ -37,8 +37,8 @@ bash-completion (1.x)
* 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, --disableexcludes, -d, -e, and
- --color completions.
+ * Add yum repolist, --enable/disablerepo, --disableexcludes, -d, -e, --color,
+ and --enable/disableplugin completions.
* Add chkconfig --override and resetpriorities completions.
* Split mplayer and friends completions to contrib/mplayer.
* Parse top level mplayer and friends option completions from -list-options.
diff --git a/contrib/yum b/contrib/yum
index ac75785..b61e166 100644
--- a/contrib/yum
+++ b/contrib/yum
@@ -28,6 +28,12 @@ _yum_repolist()
sed -ne '/^repo\(\s\+id\|list:\)/d' -e 's/[[:space:]].*//p'
}
+_yum_plugins()
+{
+ command ls /usr/lib/yum-plugins/*.py{,c,o} 2>/dev/null \
+ | sed -ne 's|.*/\([^./]*\)\.py[co]\?$|\1|p' | sort -u
+}
+
_yum()
{
local cur prev special split=false
@@ -110,6 +116,9 @@ _yum()
COMPREPLY=( $( compgen -W '$( _yum_repolist all ) \
all main' -- $cur ) )
;;
+ --enableplugin|--disableplugin)
+ COMPREPLY=( $( compgen -W '$( _yum_plugins )' -- $cur ))
+ ;;
--color)
COMPREPLY=( $( compgen -W 'always auto never' -- $cur ))
;;
--
bash-completion
More information about the Bash-completion-commits
mailing list