#compdef pkg_delete pkg_info # Thanks to the OpenBSD man pages for pkg_delete(1) and pkg_info(1) # (whence comes the switch documentation). local _pkg_delete_options _pkg_info_options _package _pkg_delete_options=( '-v[Turn on verbose output]' \ '-D[Do not execute deinstallation script]' \ '-d[Remove left-over empty directories]' \ '-n[Don''t deinstall, just report the steps to be taken]' \ '-f[Force, even if script failed or dependency exists]' \ '-p[Use this installation prefix if none specified by package]:directory:_files -/' \ '*:installed package:_package' ) _pkg_info_options=( '(* -)-a[Show information for all currently installed packages]' \ '-c[Show the one-line comment field for each package]' \ '-D[Show the install-message file (if any) for each package]' \ '-d[Show the long-description field for each package]' \ '-e[Test for the presence of another package]:prerequisite package:_package' \ '-f[Show the packing list instructions for each package]' \ '-I[Show the index entry for each package]' \ '-i[Show the install script (if any) for each package]' \ '-k[Show the de-install script (if any) for each package]' \ '-L[Show the files within each package (installed pathnames)]' \ '-l[Prefix each information category header]:directory:_files -/' \ '-m[Show the mtree file (if any) for each package]' \ '-p[Show the installation prefix for each package]' \ '-q[Be "quiet", just dump raw info]' \ '-R[Show which packages require a given package]' \ '-r[Show the requirements script (if any) for each package]' \ '-v[Turn on verbose output]' \ '*:installed package:_package' ) _package() { _values /var/db/pkg/*(-/:t) } case "$service" in pkg_delete) _arguments -s "$_pkg_delete_options[@]" && return 0 ;; pkg_info) _arguments -s "$_pkg_info_options[@]" && return 0 ;; esac