The following commit has been merged in the master branch:
commit 8c31c460c23caebfba26e3964b47fffc98f2d39a
Author: Igor Murzov <[email protected]>
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
_______________________________________________
Bash-completion-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-commits