[Bash-completion-commits] [SCM] bash-completion branch, master, updated. c8fb5f2eb1df48fd98e370967829d3e65d7c9f25

Ville Skyttä ville.skytta at iki.fi
Sat Sep 4 21:12:53 UTC 2010


The following commit has been merged in the master branch:
commit 4d0b8be863f4ae2fc254f7571622ab84a2fccc2d
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Sep 5 00:03:10 2010 +0300

    Recognize rpm query mode based on the --file, --group, --package, and --all long options (RedHat: #630328).

diff --git a/CHANGES b/CHANGES
index 48a9813..d41dccb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -15,6 +15,8 @@ bash-completion (2.x)
   * Improve /etc/init.d/* and sqlite3 completions.
   * Fix p4 completion (Alioth: #312625).
   * Add *.xsd, *.xsl, *.rng, and *.wsdl to xmllint filename completions.
+  * Recognize rpm query mode based on the --file, --group, --package, and
+    --all long options (RedHat: #630328).
 
   [ Freddy Vulto ]
   * Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095)
diff --git a/contrib/rpm b/contrib/rpm
index 20f9852..ceb4cfc 100644
--- a/contrib/rpm
+++ b/contrib/rpm
@@ -185,7 +185,7 @@ _rpm()
                 --queryformat --rcfile --requires --scripts --suggests
                 --triggeredby --triggers --whatprovides --whatrequires --xml"
 
-            if [ "${COMP_LINE#* -*([^ -])f}" != "$COMP_LINE" ]; then
+            if [ "${COMP_LINE#* -@(*([^ -])f|-file )}" != "$COMP_LINE" ]; then
                 # -qf completion
                 if [[ "$cur" == -* ]]; then
                     COMPREPLY=( $( compgen -W "$opts --dbpath --fscontext \
@@ -193,10 +193,10 @@ _rpm()
                 else
                     _filedir
                 fi
-            elif [ "${COMP_LINE#* -*([^ -])g}" != "$COMP_LINE" ]; then
+            elif [ "${COMP_LINE#* -@(*([^ -])g|-group )}" != "$COMP_LINE" ]; then
                 # -qg completion
                 _rpm_groups
-            elif [ "${COMP_LINE#* -*([^ -])p}" != "$COMP_LINE" ]; then
+            elif [ "${COMP_LINE#* -@(*([^ -])p|-package )}" != "$COMP_LINE" ]; then
                 # -qp; uninstalled package completion
                 if [[ "$cur" == -* ]]; then
                     COMPREPLY=( $( compgen -W "$opts --ftpport --ftpproxy \
@@ -209,7 +209,7 @@ _rpm()
                 if [[ "$cur" == -* ]]; then
                     COMPREPLY=( $( compgen -W "$opts --dbpath --fscontext \
                         --last --root --state" -- "$cur" ) )
-                elif [ "${COMP_LINE#* -*([^ -])a}" == "$COMP_LINE" ]; then
+                elif [ "${COMP_LINE#* -@(*([^ -])a|-all )}" == "$COMP_LINE" ]; then
                     _rpm_installed_packages "$nodig" "$nosig"
                 fi
             fi
@@ -229,11 +229,11 @@ _rpm()
                     --nofiles --noscripts --nomd5 --querytags --specfile \
                     --whatrequires --whatprovides" -- "$cur" ) )
             # check whether we're doing file completion
-            elif [ "${COMP_LINE#* -*([^ -])f}" != "$COMP_LINE" ]; then
+            elif [ "${COMP_LINE#* -@(*([^ -])f|-file )}" != "$COMP_LINE" ]; then
                 _filedir
-            elif [ "${COMP_LINE#* -*([^ -])g}" != "$COMP_LINE" ]; then
+            elif [ "${COMP_LINE#* -@(*([^ -])g|-group )}" != "$COMP_LINE" ]; then
                 _rpm_groups
-            elif [ "${COMP_LINE#* -*([^ -])p}" != "$COMP_LINE" ]; then
+            elif [ "${COMP_LINE#* -@(*([^ -])p|-package )}" != "$COMP_LINE" ]; then
                 _filedir 'rpm'
             else
                 _rpm_installed_packages "$nodig" "$nosig"

-- 
bash-completion



More information about the Bash-completion-commits mailing list