about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Cook <llua@gmx.com>2015-05-25 14:19:00 -0400
committerPeter Stephenson <pws@zsh.org>2015-05-26 09:43:12 +0100
commitd2f0b3ccb2be6dc2c600ef27b520ef89f9080dc1 (patch)
treec69bbd1d3ad12710fc389ce4c39363a18f79f063
parent9fcc105ff68b4556883ef42d7c2959ada20a65d1 (diff)
downloadzsh-d2f0b3ccb2be6dc2c600ef27b520ef89f9080dc1.tar.gz
zsh-d2f0b3ccb2be6dc2c600ef27b520ef89f9080dc1.tar.xz
zsh-d2f0b3ccb2be6dc2c600ef27b520ef89f9080dc1.zip
35292: yum install complets local files
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Redhat/Command/_yum22
2 files changed, 23 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a1819e9e8..46043a2e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-26  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* Eric Cook: 35292: Completion/Redhat/Command/_yum: complete
+	installation of local files.
+
 2015-05-23  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* 35127#1: Src/Zle/compcore.c Src/Zle/computil.c: Fix
diff --git a/Completion/Redhat/Command/_yum b/Completion/Redhat/Command/_yum
index a6983283c..f4538060e 100644
--- a/Completion/Redhat/Command/_yum
+++ b/Completion/Redhat/Command/_yum
@@ -173,20 +173,34 @@ yum_repos() {
 # Completion function for install
 (( $+functions[_yum_install] )) || _yum_install()
 {
-	_yum_available_pkgs
-	compadd "$@" -a -- _available_pkgs
+        if ! [[ $PREFIX == */* ]]; then
+          _yum_available_pkgs
+        fi
+
+        local ret=1
+        _tags files packages
+        while _tags; do
+          if _requested files; then
+            compadd "$@" -a -- _available_pkgs
+          fi
+          if _requested packages; then
+            _call_function - _yum_localinstall
+          fi
+          (( ret )) || break
+        done
+        return ret
 }
 
 # Completion function for localinstall
 (( $+functions[_yum_localinstall] )) || _yum_localinstall()
 {
-	_files -g '(#i)*.rpm(-.)'
+	_files -/ -g '(#i)*.rpm(-.)'
 }
 
 # Completion function for localupdate
 (( $+functions[_yum_localupdate] )) || _yum_localupdate()
 {
-	_files -g '(#i)*.rpm(-.)'
+	_files -/ -g '(#i)*.rpm(-.)'
 }
 
 # Completion function for update/upgrade