From 72f2b0cb1c8cf5b22537a43762bc612d396b0675 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Wed, 1 Apr 2009 15:56:09 -0400 Subject: [PATCH] yum: Complete on filenames when $cur contains / For a long time "yum install" has accepted filenames as input and will do the same thing that "yum localinstall" does. Many users no longer bother using localinstall and then find that they cannot complete a pathname with yum install. Similarly, deplist, update, and upgrade accept filenames. --- CHANGES | 4 ++++ contrib/yum | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index 12617279..2dbef89f 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,10 @@ bash-completion (1.x) completions. * Add chkconfig --override and resetpriorities completions. + [ Todd Zullinger ] + * Make yum complete on filenames after install, deplist, update and upgrade + when the following argument contains a slash. + -- David Paleino Wed, 25 Mar 2009 23:18:24 +0100 bash-completion (1.0) diff --git a/contrib/yum b/contrib/yum index e5af2d30..70ca365e 100644 --- a/contrib/yum +++ b/contrib/yum @@ -43,6 +43,10 @@ _yum() done if [ -n "$special" ]; then + if [[ "$cur" == */* && "$special" == @(deplist|install|update|upgrade) ]]; then + _filedir rpm + return 0 + fi case $special in install) _yum_list available