Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Allow ''yum install'' to complete local files
- X-seq: zsh-workers 35292
- From: Eric Cook <llua@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Allow ''yum install'' to complete local files
- Date: Mon, 25 May 2015 14:19:00 -0400
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
---
Completion/Redhat/Command/_yum | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/Completion/Redhat/Command/_yum b/Completion/Redhat/Command/_yum
index a698328..f453806 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
--
2.3.7
Messages sorted by:
Reverse Date,
Date,
Thread,
Author