[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-235-g26ae770
Igor Murzov
igor at gplsoft.org
Mon May 2 10:27:24 UTC 2011
The following commit has been merged in the master branch:
commit c18a7e3f95e8efc1a260834003749e769dc3a9da
Merge: 0815000f679f8600e379c6d66bdedb5a21389d28 13e811b1f98aa592ef80cca4b66037426db73b75
Author: Igor Murzov <igor at gplsoft.org>
Date: Thu Oct 14 02:44:32 2010 +0400
Merge branch 'master' into garik
diff --combined completions/pkgtools
index 60a2d92,3a5df27..60a2d92
--- a/completions/pkgtools
+++ b/completions/pkgtools
@@@ -1,131 -1,17 +1,131 @@@
# bash completion for Slackware Linux pkgtools
-have removepkg && [ -f /etc/slackware-version ] &&
-_removepkg()
+[ -f /etc/slackware-version ] &&
+{
+
+have pkgtool &&
+_pkgtool()
{
- local packages cur
+ COMPREPLY=()
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--sets --ignore_tagfiles --tagfile \
+ --source_mounted --source_dir --target_dir --source_device' \
+ -- "$cur" ) )
+ return 0
+ fi
+
+ local prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ case $prev in
+ --source_dir|--target_dir)
+ _filedir -d
+ return 0
+ ;;
+ --sets)
+ # argument required but no completions available
+ return 0
+ ;;
+ --source_device)
+ COMPREPLY=( $( compgen -f -d -- "${cur:-/dev/}" ) )
+ return 0
+ ;;
+ --tagfile)
+ _filedir
+ return 0
+ ;;
+ esac
+} &&
+complete -F _pkgtool pkgtool
+have removepkg &&
+_removepkg()
+{
COMPREPLY=()
- _get_comp_words_by_ref cur
+ 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 dirnames -f -X '!*.t[bglx]z' installpkg upgradepkg explodepkg
+complete -F _removepkg -o filenames removepkg
+
+have upgradepkg &&
+_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
+
+have installpkg &&
+_installpkg()
+{
+ COMPREPLY=()
+ local cur=`_get_cword`
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--warn --md5sum --root --infobox \
+ --menu --ask --priority --tagfile' -- "$cur") )
+ return 0
+ fi
+
+ local prev=`_get_pword`
+
+ case $prev in
+ --root)
+ _filedir -d
+ return 0
+ ;;
+ --priority)
+ COMPREPLY=( $( compgen -W 'ADD REC OPT SKP' -- "$cur" ) )
+ return 0
+ ;;
+ --tagfile)
+ _filedir
+ return 0
+ ;;
+ esac
+
+ COMPREPLY=( $(compgen -f -X "!*.t[bglx]z" -- "$cur") \
+ $(compgen -d -- "$cur") )
+} && complete -F _installpkg -o filenames installpkg
+
+have makepkg &&
+_makepkg()
+{
+ COMPREPLY=()
+ local cur=`_get_cword`
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '-l --linkadd -p --prepend \
+ -c --chown' -- "$cur") )
+ return 0
+ fi
+
+ local prev=`_get_pword`
+
+ case $prev in
+ -l|-l|-c|--chown)
+ COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ _filedir
+} && complete -F _makepkg -o filenames makepkg
+
+have explodepkg &&
+complete -o plusdirs -f -X '!*.t[bglx]z' explodepkg
+
+}
# Local variables:
# mode: shell-script
--
bash-completion
More information about the Bash-completion-commits
mailing list