From 2a090eea709f59f196d64cc357e60d74aadde53b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 24 Jul 2008 12:03:52 +0200 Subject: etc/completions/_pkg: Switched to arguments, added packagename completion --- etc/completions/_pkg | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'etc') diff --git a/etc/completions/_pkg b/etc/completions/_pkg index 5d95860..8936704 100644 --- a/etc/completions/_pkg +++ b/etc/completions/_pkg @@ -1,30 +1,28 @@ #compdef pkg ## vim:ft=zsh -local values local arguments +local all installed + +all=(pkg -list-all) +installed=(pkg -list) -#TODO: seperate values that need arguments from those that don't, -# make this all nicer in general -values=( - 'add[install package]' - 'changelog[show changelog of package]' - 'changeroot[change default url for al packages]' - 'delete[remove package]' - 'info[show package info]' - 'install[install package]' - 'list[list installed packages]' - 'list-all[list remote available packages]' - 'local-update[update local packages list]' - 'log[show package log]' - 'remote-update[update remote pckages list]' - 'remove[remove package]' - 'status[check packages dependencies etc]' - 'update[update packages lists]' - 'upgrade[upgrade packages]' -) arguments=( - '*:file:_path_files -W /home/derf/packages -/' + '-add[install package]:package:($($all))' + '-changelog[show changelog of package]:package:($($installed))' + '-changeroot[change default url for al packages]' + '-delete[remove package]:package:($($installed))' + '-info[show package info]:package:($($installed))' + '-install[install package]:package:($($all))' + '-list[list installed packages]' + '-list-all[list remote available packages]' + '-local-update[update local packages list]' + '-log[show package log]:package:($($installed))' + '-remote-update[update remote pckages list]' + '-remove[remove package]:package:($($installed))' + '-status[check packages dependencies etc]::package:($($installed))' + '-update[update packages lists]' + '-upgrade[upgrade packages]::package:($($installed))' + '' ) -_values -s ' ' -S ' ' -w 'pkg function' $values _arguments -s $arguments -- cgit v1.2.3