From f66d76f4414111f79dc73eb0f8b76f12741b4b81 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 4 Apr 2009 21:56:55 +0200 Subject: pkg: pkg_list: Also list not-installed packages, depending on argument --- provides/zsh/completions/_pkg | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'provides/zsh') diff --git a/provides/zsh/completions/_pkg b/provides/zsh/completions/_pkg index b28b1b3..e0d0b00 100644 --- a/provides/zsh/completions/_pkg +++ b/provides/zsh/completions/_pkg @@ -9,23 +9,23 @@ typeset expl function _pkg_action () { _wanted action expl 'action' \ - compadd add install delete eval remove info list{,-all} \ + compadd add install delete eval remove info list \ local-update log pull push remote-update refresh status update upgrade } function _pkg_installed () { _wanted package expl 'local package' \ - compadd $(pkg list) + compadd $(pkg list local) } function _pkg_all () { _wanted package expl 'package' \ - compadd $(pkg list-all) + compadd $(pkg list all) } function _pkg_notinstalled () { _wanted package expl 'remote package' \ - compadd $(diff <(pkg list) <(pkg list-all) | grep "^>" | cut -d " " -f 2) + compadd $(pkg list remote) } function _pkg_args { @@ -46,6 +46,10 @@ function _pkg_args { compadd $(grep -E '^\S*\s*\(\)\s*{' =pkg | cut -d ' ' -f 1) \ $(grep -E 'function \S* (\(\) )?{' =pkg | cut -d ' ' -f 2) ;; + list) + _wanted something expl 'list mode' \ + compadd all local remote + ;; *) _message 'no more arguments' ;; -- cgit v1.2.3