1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 14:04:03 +01:00
zsh/Completion/Debian/_dpkg

115 lines
5.4 KiB
Plaintext
Raw Normal View History

#compdef dpkg dpkg-deb
1999-11-04 00:37:15 +01:00
2000-06-04 20:32:19 +02:00
local _dpkg_deb_actions _dpkg_common_actions _dpkg_actions _dpkg_options
local curcontext="$curcontext" state line expl ret
typeset -A opt_args
_dpkg_deb_actions=('(--build)-b[build archive]:directory:_files -/' \
'(-b)--build:directory:_files -/' \
'(--contents)-c[list contents]:Debian package:_files -g \*.deb' \
'(-c)--contents:Debian package:_files -g \*.deb' \
'(--info)-I[show info]:Debian package:_files -g \*.deb' \
'(-I)--info:Debian package:_files -g \*.deb' \
'(--field)-f[show fields]:Debian package:_files -g \*.deb' \
'(-f)--field:Debian package:_files -g \*.deb' \
'(--control)-e[extract control]:Debian package:_files -g \*.deb' \
'(-e)--control:Debian package:_files -g \*.deb' \
'(--extract)-x[extract files]:Debian package:_files -g \*.deb' \
'(-x)--extract:Debian package:_files -g \*.deb' \
'(--vextract)-X[extract and list files]:Debian package:_files -g \*.deb' \
'(-X)--vextract[extract and list]:Debian package:_files -g \*.deb' \
'--fsys-tarfile[output fs tarfile]:Debian package:_files -g \*.deb')
2000-06-04 20:32:19 +02:00
_dpkg_common_actions=('--help[show help]' \
'--version[show version]' \
2000-06-04 20:32:19 +02:00
'(--license)--licence[show licencing]' \
'(--licence)--license[show licensing]')
2000-06-04 20:32:19 +02:00
_dpkg_actions=('(--install)-i[install packages]:*:Debian packages:->install' \
'(-i)--install:*:Debian packages:->install' \
1999-11-04 00:37:15 +01:00
'--unpack[unpack package]:Debian package:_files -g \*.deb' \
'--configure:package:_deb_packages installed' \
2000-06-04 20:32:19 +02:00
'(--remove)-r[remove package]:*:package:->remove' \
'(-r)--remove:*:package:->remove' \
'(--purge)-P[purge package]:*:package:->purge' \
'(-P)--purge:*:package:->purge' \
'(--print-avail)-p[display available details]:packages:_deb_packages avail' \
'(-p)--print-avail:packages:_deb_packages avail' \
1999-11-04 00:37:15 +01:00
'--update-avail[update available]:package file:_files' \
'--merge-avail[merge available]:package file:_files' \
2000-06-04 20:32:19 +02:00
'(--record-avail)-A[record available]:package file:_files' \
'(-A)--record-avail:package file:_files' \
'--forget-old-unavail[forget uninstalled unavailable]' \
2000-06-04 20:32:19 +02:00
'--clear-avail[clear available]' \
'(--list)-l[list packages]:*:packages:->list' \
'(-l)--list:*:packages:->list' \
'(--status)-s[display package status]:*:packages:->status' \
'(-s)--status:*:packages:->status' \
1999-11-04 00:37:15 +01:00
'(--audit)-C[check for broken pkgs]' \
'(-C)--audit' \
2000-06-04 20:32:19 +02:00
'--get-selections[get selections]:pattern:' \
'--set-selections[set selections]' \
'--yet-to-unpack[list uninstalled]' \
'(--listfiles)-L[list owned files]:*:packages:->listfiles' \
'(-L)--listfiles:*:packages:->listfiles' \
'(--search)-S[search for file owner]:*:pattern:->search' \
'(-S)--search:*:pattern:->search' \
1999-11-04 00:37:15 +01:00
'--print-architecture[print target architecture]' \
'--print-gnu-build-architecture[print GNU version of target architecture]' \
'--print-installation-architecture[print host architecture]' \
2000-06-04 20:32:19 +02:00
'--compare-versions[compare version numbers]:expression:')
_dpkg_options=('--abort-after[abort after errors]:number of errors:' \
1999-11-04 00:37:15 +01:00
'--admindir=[data directory]:directory:_files -/' \
'--root=[alternative root]:root:_files -/' \
'--instdir=[change inst root but not data dir]:_files -/' \
'(--selected-only)-O[skip unselected packages]' \
'(-O)--selected-only' \
1999-11-04 00:37:15 +01:00
'(--skip-same-version)-E[skip packages with same version as installed]' \
'(-E)--skip-same-version' \
1999-11-04 00:37:15 +01:00
'(--refuse-downgrade)-G[skip packages with earlier version than installed]' \
'(-G)--refuse-downgrade' \
1999-11-04 00:37:15 +01:00
'(--auto-deconfigure)-B[install can break other packages]' \
'(-B)--auto-deconfigure' \
1999-11-04 00:37:15 +01:00
'--largemem[optimize for >4Mb RAM]' \
'--smallmem[optimize for <4Mb RAM]' \
'--no-act[show potential actions but do not follow through]' \
'-D+[debug options]:debug options:(h 1 2 3)' \
'--debug=[debug options]:debug options:(help 1 2 3)' \
'--ignore-depends=[ignore depends involving package]:package:_deb_packages avail' \
2000-06-04 20:32:19 +02:00
--{force,refuse,no-force}'--[forcing options]:what:(auto-select downgrade configure-any hold bad-path not-root overwrite overwrite-diverted depends-version depends confnew confold confdef confmiss conflicts architecture overwrite-dir remove-reinstreq remove-essential)')
case "${words[1]:t}" in
dpkg)
_arguments -C -s "$_dpkg_actions[@]" \
"$_dpkg_deb_actions[@]" \
"$_dpkg_common_actions[@]" \
"$_dpkg_options[@]"
;;
dpkg-deb)
2000-06-04 20:32:19 +02:00
_arguments "$_dpkg_deb_actions[@]" \
"$_dpkg_common_actions[@]"
;;
esac
2000-06-04 20:32:19 +02:00
case "$state" in
install)
_funcall ret _dpkg_$state && return ret
_arguments -C -s "$_dpkg_options[@]" \
'*:Debian package:_files -g \*.deb'
;;
remove|purge|status|listfiles)
_funcall ret _dpkg_$state && return ret
_arguments -C -s "$_dpkg_options[@]" \
'*:package:_deb_packages installed'
;;
list)
_funcall ret _dpkg_$state && return ret
_arguments -C -s "$_dpkg_options[@]" \
'*:packages:_deb_packages avail' \
;;
esac