From 348eaca4a92d66b5454195bd6317d554db5656b2 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 14 Sep 2008 21:40:06 +0200 Subject: More excessive completion --- provides/zsh/completions/_pkg | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'provides') diff --git a/provides/zsh/completions/_pkg b/provides/zsh/completions/_pkg index ef1da1e..0bd1b27 100644 --- a/provides/zsh/completions/_pkg +++ b/provides/zsh/completions/_pkg @@ -43,11 +43,29 @@ if (( CURRENT == 2 )) { ;; eval) _message 'shell code for evaluation' + _wanted function expl 'internal function' \ + compadd $(grep -E '^\S*\s*\(\)\s*{' ~/bin/pkg | cut -d ' ' -f 1) ;; *) _message 'no more arguments' ;; esac +} elif [[ ${words[2]} = 'eval' ]] { + _message 'shell code for evaluation' + if (( CURRENT == 4 )) { + case ${words[3]} in + exec_hook|check_prereqs|*_collected|) + _pkg_installed + ;; + esac + } elif (( CURRENT == 5 )) { + case ${words[3]} in + exec_hook) + _wanted hook expl 'package hook' \ + compadd $(ls -1 ~/packages/${words[4]}/hooks 2> /dev/null) + ;; + esac + } } else { _message 'no more arguments' } -- cgit v1.2.3