-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_pkg
46 lines (41 loc) · 1.25 KB
/
_pkg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#compdef pkg
#local context curcontext="$curcontext" state line
local -a _pkg_subcommands
_pkg_subcommands() {
local commands;
commands=( 'help:print help message.'
'install:install package'
'remove:remove package'
'search:search package'
'upgrade:upgrade single package or all packages'
'info:show information for package'
'which:check to which package a file belongs'
'files:list files contained in package'
'clean:remove obsolete packages from package cache'
'hold:hold package'
'unhold:unhold package'
'deps:list dependencies for package'
'revdeps:list packages which need package'
'orphans:list orphaned packages'
'db:calls xbps-pkgdb'
'alternatives:calls xbps-alternatives'
'query:calls xbps-query'
'reconfigure:calls xbps-reconfigure'
'rindex:calls xbps-rindex'
)
_describe -t commands 'pkg command' commands "$@"
}
#_all_pkgs() {
# xpkg -a
#}
_arguments -C \
'1: :_pkg_subcommands' \
'*::arg:->args' \
&& return 0
#case $state in
# (args)
# case $line[1] in
# (install|search|info|deps|revdeps)
# _arguments '1:: :_all_pkgs' && ret=0
# esac
#esac