[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-235-g26ae770
Igor Murzov
igor at gplsoft.org
Mon May 2 10:27:52 UTC 2011
The following commit has been merged in the master branch:
commit 8c31c460c23caebfba26e3964b47fffc98f2d39a
Author: Igor Murzov <igor at gplsoft.org>
Date: Mon Jan 24 04:01:00 2011 +0300
Improve slackpkg completion
Make install, reinstall, upgrade, ... actions also complete
filenames and disk sets.
diff --git a/completions/slackpkg b/completions/slackpkg
index 340e574..d9bf811 100644
--- a/completions/slackpkg
+++ b/completions/slackpkg
@@ -49,16 +49,21 @@ _slackpkg()
return 0
;;
remove)
- COMPREPLY=( $( (cd /var/log/packages; compgen -f -- "$cur") ) )
+ _filedir
+ COMPREPLY+=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x \
+ xap y' -- "$cur" ) )
+ COMPREPLY+=( $( (cd /var/log/packages; compgen -f -- "$cur") ) )
+ return 0
+ ;;
+ install|reinstall|upgrade|blacklist|download)
+ _filedir
+ COMPREPLY+=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x \
+ xap y' -- "$cur" ) )
+ COMPREPLY+=( $( grep "^PACKAGE NAME: *$cur" \
+ "${WORKDIR}/PACKAGES.TXT" 2>/dev/null | \
+ sed 's/^PACKAGE NAME: *//g' ) )
return 0
;;
- reinstall|upgrade)
- # FIXME: ideally we should intersect list of installed packages
- # with list of available packages
- ;&
- install|blacklist|download)
- # FIXME: may be something better than just package names is possible
- ;&
info)
COMPREPLY=( $( grep "^PACKAGE NAME: *$cur" \
"${WORKDIR}/PACKAGES.TXT" 2>/dev/null | \
--
bash-completion
More information about the Bash-completion-commits
mailing list