Parent directory

_port

1545 bytes
 1#compdef port
 2
 3local subcmds
 4
 5# we cache the list of ports
 6# we shall use some cache policy to avoid problems with new ports
 7if (( ! $+portlist )); then
 8	portlist=($(port echo all; echo "all current active inactive installed uninstalled outdated"))
 9fi
10
11subcmds=(
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'rdependents'
45'rdeps'
46'reclaim'
47'rpmpackage'
48'search'
49'selfupdate'
50'sync'
51'test'
52'unarchive'
53'uninstall'
54'upgrade'
55'variants'
56'version'
57)
58
59_arguments -C \
60'-v[verbose mode (generate verbose messages)]' \
61'-d[debug mode (generate debugging messages)]' \
62'-q[quiet mode (suppress messages)]' \
63'-D[specify portdir]' \
64'-k[keep mode (do not autoclean after install)]' \
65'-n[dont follow dependencies in upgrade (only for upgrading)]' \
66'-a[upgrade all installed ports (only for upgrading)]' \
67'-u[uninstall non-active ports when upgrading and uninstalling]' \
68'-f[force mode (ignore state file)]' \
69'-s[source-only mode]' \
70'-b[binary-only mode]' \
71'-o[honor state files older than Portfile]' \
72'*::command:->command' \
73&& return 0
74
75case $state in
76	command)
77	if ((CURRENT == 1)); then
78		state=subcommands
79	else
80		state=portname
81	fi
82	;;
83esac
84
85case $state in
86	subcommands)
87	_describe -t commands 'port commands' subcmds
88	;;
89	portname)
90	_describe -t commands 'available ports' portlist
91	;;
92esac