[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-235-g26ae770
Igor Murzov
igor at gplsoft.org
Mon May 2 10:26:57 UTC 2011
The following commit has been merged in the master branch:
commit 0dd7eb373135ef617893b68ad4498ca38d155f64
Author: Igor Murzov <igor at gplsoft.org>
Date: Mon May 24 02:28:48 2010 +0400
Add option completion for upgradepkg
diff --git a/contrib/pkgtools b/contrib/pkgtools
index c2b9929..a0aa598 100644
--- a/contrib/pkgtools
+++ b/contrib/pkgtools
@@ -16,7 +16,7 @@ _pkgtool()
local split=false
_split_longopt && split=true
-
+
case $prev in
--source_dir|--target_dir)
_filedir -d
@@ -31,9 +31,9 @@ _pkgtool()
return 0
;;
esac
-
+
$split && return 0
-
+
local IFS=$'\t\n'
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
$( compgen -d -- "$cur" ) )
@@ -55,7 +55,21 @@ _removepkg()
} &&
complete -F _removepkg -o filenames removepkg
-complete -o plusdirs -f -X '!*.t[bglx]z' installpkg upgradepkg explodepkg
+have upgradepkg && [ -f /etc/slackware-version ] &&
+_upgradepkg()
+{
+ COMPREPLY=()
+ local cur=`_get_cword`
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--dry-run --install-new --reinstall \
+ --verbose' -- "$cur") )
+ return 0
+ fi
+
+ COMPREPLY=( $(compgen -f -X "!*.t[bglx]z" -- "$cur") )
+} && complete -F _upgradepkg -o plusdirs upgradepkg
+
+complete -o plusdirs -f -X '!*.t[bglx]z' installpkg explodepkg
# Local variables:
# mode: shell-script
--
bash-completion
More information about the Bash-completion-commits
mailing list