]> git.rmz.io Git - dotfiles.git/blob - zsh/plugins/macports/_port
add xbindkeysrc
[dotfiles.git] / zsh / plugins / macports / _port
1 #compdef port
2
3 local subcmds
4
5 # we cache the list of ports
6 # we shall use some cache policy to avoid problems with new ports
7 if (( ! $+portlist )); then
8 portlist=($(port echo all; echo "all current active inactive installed uninstalled outdated"))
9 fi
10
11 subcmds=(
12 'activate'
13 'archive'
14 'build'
15 'cat'
16 'clean'
17 'configure'
18 'contents'
19 'deactivate'
20 'dependents'
21 'deps'
22 'destroot'
23 'dir'
24 'distcheck'
25 'distclean'
26 'dmg'
27 'echo'
28 'edit'
29 'extract'
30 'fetch'
31 'file'
32 'help'
33 'info'
34 'install'
35 'installed'
36 'list'
37 'livecheck'
38 'location'
39 'mpkg'
40 'outdated'
41 'patch'
42 'pkg'
43 'provides'
44 'rpmpackage'
45 'search'
46 'selfupdate'
47 'sync'
48 'test'
49 'unarchive'
50 'uninstall'
51 'upgrade'
52 'variants'
53 'version'
54 )
55
56 _arguments -C \
57 '-v[verbose mode (generate verbose messages)]' \
58 '-d[debug mode (generate debugging messages)]' \
59 '-q[quiet mode (suppress messages)]' \
60 '-D[specify portdir]' \
61 '-k[keep mode (do not autoclean after install)]' \
62 '-n[dont follow dependencies in upgrade (only for upgrading)]' \
63 '-a[upgrade all installed ports (only for upgrading)]' \
64 '-u[uninstall non-active ports when upgrading and uninstalling]' \
65 '-f[force mode (ignore state file)]' \
66 '-s[source-only mode]' \
67 '-b[binary-only mode]' \
68 '-o[honor state files older than Portfile]' \
69 '*::command:->command' \
70 && return 0
71
72 case $state in
73 command)
74 if ((CURRENT == 1)); then
75 state=subcommands
76 else
77 state=portname
78 fi
79 ;;
80 esac
81
82 case $state in
83 subcommands)
84 _describe -t commands 'port commands' subcmds
85 ;;
86 portname)
87 _describe -t commands 'available ports' portlist
88 ;;
89 esac