Skip to content

Commit 205172c

Browse files
classabbyampDuncaen
authored andcommitted
data/_xbps: add missing completions, improve some existing ones
1 parent 206da9f commit 205172c

1 file changed

Lines changed: 76 additions & 41 deletions

File tree

data/_xbps

Lines changed: 76 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,41 @@ _xbps_common=(
1010
)
1111

1212
_xbps_properties=(
13-
alternatives
14-
architecture
15-
archive-compression-type
16-
automatic-install
17-
build-date
18-
build-options
19-
conf_files
20-
conflicts
21-
filename-sha256
22-
filename-size
23-
homepage
24-
install-date
25-
install-msg
26-
install-script
27-
installed_size
28-
license
29-
maintainer
30-
metafile-sha256
31-
pkgver
32-
preserve
33-
provides
34-
remove-msg
35-
remove-script
36-
replaces
37-
repolock
38-
repository
39-
reverts
40-
run_depends
41-
shlib-provides
42-
shlib-requires
43-
short_desc
44-
source-revisions
45-
state
13+
'alternatives[group and file alternatives provided by the package]'
14+
'architecture[target architecture the package was built for]'
15+
'automatic-install[package was installed automatically]'
16+
'build-options[enabled options the package was built with]'
17+
'changelog[changelog URL for the package]'
18+
'conf_files[configuration file(s) installed by the package]'
19+
'conflicts[other packages this package conflicts with]'
20+
'filename-sha256[hash of the package file]'
21+
'filename-size[size of the package file]'
22+
'hold[package is held and will not be updated]'
23+
'homepage[home URL of the package project]'
24+
'install-date[date when the package was installed]'
25+
'install-msg[post-install message provided by the package]'
26+
'install-script[script run when installing the package]'
27+
'installed_size[total size of files installed by the package]'
28+
'license[license(s) for distributing the package]'
29+
'maintainer[contact information of the maintainer of the package]'
30+
'metafile-sha256[hash of the plist package files metadata]'
31+
'pkgname[name of the package]'
32+
'pkgver[version of the package]'
33+
'preserve[package files will not be removed automatically on update]'
34+
'provides[virtual packages provided by the package]'
35+
'remove-msg[post-remove message provided by the package]'
36+
'remove-script[script run when removing the package]'
37+
'replaces[other packages that the package replaces]'
38+
'repolock[package only accepts updates from its original repository]'
39+
'repository[repository where the package was installed from]'
40+
'reverts[previous provided version this package replaces]'
41+
'run_depends[runtime dependency packages for the package]'
42+
'shlib-provides[shared libraries provided by the package]'
43+
'shlib-requires[shared libraries required by the package]'
44+
'short_desc[short description of the package]'
45+
'source-revisions[source package and commit hash of package last change from the void-packages repository]'
46+
'state[installation state of the package]'
47+
'tags[list of categories the package is associated with]'
4648
)
4749

4850
_xbps_all_packages() {
@@ -60,9 +62,14 @@ _xbps_alternatives_groups() {
6062
_xbps_alternatives() {
6163
_arguments -s : \
6264
$_xbps_common \
65+
-R'[Enable repository mode]' \
66+
'*'--repository=-'[Add repository to the top of the list]:repository url:_files -/' \
67+
{-i,--ignore-conf-repos}'[Ignore repositories defined in xbps.d]' \
6368
{-g,--group}'[Group of alternatives to match]:group:_xbps_alternatives_groups' \
69+
- '(mode)' \
6470
{-l,--list}'[List all alternatives]' \
6571
{-s,--set}'[Set alternatives]' \
72+
- '(default)' \
6673
'*:installed packages:_xbps_installed_packages'
6774
}
6875

@@ -71,7 +78,10 @@ _xbps_checkvers() {
7178
$_xbps_common \
7279
{-D,--distdir}'[Set the path to void-packages]:path:_files -/' \
7380
{-i,--installed}'[Check for outdated packages in rootdir]' \
74-
{-s,--show-missing}'[List any binary packages which are not built]' \
81+
{-m,--manual}'[Only process listed files]' \
82+
'*'{-R,--repository=-}'[Add repository to the top of the list]:repository url:_files -/' \
83+
{-i,--ignore-conf-repos}'[Ignore repositories defined in xbps.d]' \
84+
{-s,--show-all}'[List any binary packages which are not built]' \
7585
--staging'[Enable use of staged packages]' \
7686
'*:extra packages:_files'
7787
}
@@ -93,6 +103,7 @@ _xbps_create() {
93103
{-p,--preserve}'[Enable package preserve boolean]' \
94104
{-q,--quiet}'[Work silently]' \
95105
{-R,--replaces}'[Replaces]:replaces: ' \
106+
{-r,--reverts}'[Reverts]:reverts: ' \
96107
{-S,--long-desc}'[Long description]:long description: ' \
97108
{-s,--desc}'[Short description]:short description: ' \
98109
{-t,--tags}'[A list of tags/categories]:tags: ' \
@@ -125,35 +136,49 @@ _xbps_install() {
125136
$_xbps_common \
126137
{-A,--automatic}'[Set automatic installation mode]' \
127138
{-c,--cachedir=-}'[Full path to cachedir]:cache dir:_files -/' \
128-
{-n,--dry-run}'[Dry-run mode]' \
139+
{-D,--download-only}'[Download packages and check integrity, nothing else]' \
129140
{-f,--force}'[Force package re-installation]' \
130141
{-i,--ignore-conf-repos}'[Ignore repositories defined in xbps.d]' \
142+
{-I,--ignore-file-conflicts}'[Ignore detected file conflicts]' \
143+
{-U,--unpack-only}'[Unpack packages without configuring]' \
131144
{-M,--memory-sync}'[Keep remote repository data in memory only]' \
145+
{-n,--dry-run}'[Dry-run mode]' \
132146
'*'{-R,--repository=-}'[Add repository to the top of the list]:repository url:_files -/' \
133147
{-S,--sync}'[Sync remote repository index]' \
148+
--reproducible'[Enable reproducible mode in pkgdb]' \
134149
--staging'[Enable use of staged packages]' \
135150
{-u,--update}'[Update target packages]' \
136-
{-U,--unpack-only}'[Unpack packages without configuring]' \
137151
{-y,--yes}'[Assume yes to all questions]' \
138152
'*:available packages:_xbps_all_packages'
139153
}
140154

141155
_xbps_pkgdb() {
142-
_arguments -s : \
156+
local ret=1
157+
local -a checks=(files dependencies alternatives pkgdb)
158+
_arguments -C -s : \
143159
$_xbps_common \
144160
{-a,--all}'[Process all packages]' \
161+
--checks='[Choose checks to run]:check:->checks' \
145162
{-m,--mode}'[Change to this mode]:mode:(auto manual hold unhold repolock repounlock)' \
146163
{-u,--update}'[Update pkgdb to the latest format]' \
147-
'*:installed packages:_xbps_installed_packages'
164+
'*:installed packages:_xbps_installed_packages' && ret=0
165+
166+
case $state in
167+
checks)
168+
_values -s , "check" "${checks[@]}" && ret=0
169+
;;
170+
esac
171+
return $ret
148172
}
149173

150174
_xbps_query() {
175+
local ret=1
151176
_arguments -s : \
152177
$_xbps_common \
153178
{-c,--cachedir=-}'[Full path to cachedir]:cache dir:_files -/' \
154179
{-i,--ignore-conf-repos}'[Ignore repositories defined in xbps.d]' \
155180
{-M,--memory-sync}'[Keep remote repository data in memory only]' \
156-
{-p,--property=-}'[Show properties]:property:($_xbps_properties)' \
181+
{-p,--property=-}'[Show properties]:property:->properties' \
157182
--regex'[Use Extended Regular Expressions to match]' \
158183
--fulldeptree'[Full dependency tree for -x/--deps]' \
159184
-R'[Enable repository mode]' \
@@ -174,16 +199,25 @@ _xbps_query() {
174199
{-x,--deps}'[Show dependencies]:package:_xbps_all_packages' \
175200
{-X,--revdeps}'[Show reverse dependencies]:package:_xbps_all_packages' \
176201
- '(default)' \
177-
':package:_xbps_all_packages'
202+
':package:_xbps_all_packages' && ret=0
203+
204+
case $state in
205+
properties)
206+
_values -s , "property" "${_xbps_properties[@]}" && ret=0
207+
;;
208+
esac
209+
return $ret
178210
}
179211

180212
_xbps_reconfigure() {
181213
_arguments -s : \
182214
$_xbps_common \
183215
{-a,--all}'[Process all packages]' \
184216
{-f,--force}'[Force reconfiguration]' \
217+
{-x,--deps}'[Also process dependencies for each package]' \
218+
--fulldeptree'[Full dependency tree for -x/--deps]' \
185219
'*'{-i,--ignore}'[Ignore package for reconfigure]:installed packages:_xbps_installed_packages' \
186-
'*:installed packages:_xbps_installed_packages'
220+
'*:installed packages:_xbps_installed_packages'
187221
}
188222

189223
_xbps_remove() {
@@ -193,6 +227,7 @@ _xbps_remove() {
193227
{-F,--force-revdeps}'[Force package removal even with revdeps/unresolved shared libraries]' \
194228
{-f,--force}'[Force package files removal]' \
195229
{-O,--clean-cache}'[Remove obsolete packages in cachedir]' \
230+
-OO'[Remove obsolete and uninstalled packages in cachedir]' \
196231
{-o,--remove-orphans}'[Remove package orphans]' \
197232
{-n,--dry-run}'[Dry-run mode]' \
198233
{-R,--recursive}'[Recursively remove dependencies]' \

0 commit comments

Comments
 (0)