diff options
author | Igor Murzov <igor@gplsoft.org> | 2011-01-09 05:00:27 +0300 |
---|---|---|
committer | Igor Murzov <igor@gplsoft.org> | 2011-01-09 05:00:27 +0300 |
commit | 1f453c97462f3668bb5743ed1bf10b1c933c4b7e (patch) | |
tree | 3622b59eb8848121f4c03fba0c2e7cfd11ae9580 /completions/slackpkg | |
parent | 81bc6b778b5750baf1d5a93615fb101a1792a1fd (diff) | |
download | bash-completion-1f453c97462f3668bb5743ed1bf10b1c933c4b7e.tar.gz |
Improve completion for slackpkg
Diffstat (limited to 'completions/slackpkg')
-rw-r--r-- | completions/slackpkg | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/completions/slackpkg b/completions/slackpkg index 1afa3b21..340e574b 100644 --- a/completions/slackpkg +++ b/completions/slackpkg @@ -41,10 +41,6 @@ _slackpkg() # argument required but no completions available return 0 ;; - install|reinstall|upgrade|remove|blacklist|download) - # FINISHME - return 0 - ;; install-template|remove-template) if [ -e "$confdir/templates" ]; then COMPREPLY=( $( (cd "$confdir/templates"; \ @@ -52,9 +48,21 @@ _slackpkg() fi return 0 ;; + remove) + COMPREPLY=( $( (cd /var/log/packages; compgen -f -- "$cur") ) ) + 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 | sed 's/^PACKAGE NAME: *//g' ) ) + "${WORKDIR}/PACKAGES.TXT" 2>/dev/null | \ + sed 's/^PACKAGE NAME: *//g' ) ) return 0 ;; update) |