[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-235-g26ae770

Igor Murzov igor at gplsoft.org
Mon May 2 10:26:56 UTC 2011


The following commit has been merged in the master branch:
commit f595b60bde1ea9c083d473eb679134283d7e79c0
Author: Igor Murzov <igor at gplsoft.org>
Date:   Mon May 24 02:01:13 2010 +0400

    Add option completion for removepkg

diff --git a/contrib/pkgtools b/contrib/pkgtools
index 498ce04..c2b9929 100644
--- a/contrib/pkgtools
+++ b/contrib/pkgtools
@@ -34,8 +34,6 @@ _pkgtool()
     
     $split && return 0
     
-    _expand || return 0
-    
     local IFS=$'\t\n'
     COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
         $( compgen -d -- "$cur" ) )
@@ -47,11 +45,17 @@ _removepkg()
 {
     COMPREPLY=()
     local cur=`_get_cword`
+    if [[ "$cur" == -* ]]; then
+        COMPREPLY=( $( compgen -W '-copy -keep -preserve -warn' \
+            -- "$cur" ) )
+        return 0
+    fi
 
     COMPREPLY=( $( (cd /var/log/packages; compgen -f -- "$cur") ) )
 } &&
-complete -F _removepkg -o filenames removepkg &&
-    complete -o plusdirs -f -X '!*.t[bglx]z' installpkg upgradepkg explodepkg
+complete -F _removepkg -o filenames removepkg
+
+complete -o plusdirs -f -X '!*.t[bglx]z' installpkg upgradepkg explodepkg
 
 # Local variables:
 # mode: shell-script

-- 
bash-completion



More information about the Bash-completion-commits mailing list