diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-07-24 12:03:52 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-07-24 12:03:52 +0200 |
commit | 2a090eea709f59f196d64cc357e60d74aadde53b (patch) | |
tree | a728115a9208a3dd67b6c914712f61837a448e40 /etc | |
parent | 68e2ccea7c4d0d54f09a0e2998764dfb9ae45dc3 (diff) |
etc/completions/_pkg: Switched to arguments, added packagename completion
Diffstat (limited to 'etc')
-rw-r--r-- | etc/completions/_pkg | 42 |
1 files changed, 20 insertions, 22 deletions
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 |