about summary refs log tree commit diff
path: root/Completion/Cygwin/Command/_cygcheck
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Cygwin/Command/_cygcheck')
-rw-r--r--Completion/Cygwin/Command/_cygcheck39
1 files changed, 28 insertions, 11 deletions
diff --git a/Completion/Cygwin/Command/_cygcheck b/Completion/Cygwin/Command/_cygcheck
index d0a78a248..e0d7532e2 100644
--- a/Completion/Cygwin/Command/_cygcheck
+++ b/Completion/Cygwin/Command/_cygcheck
@@ -1,14 +1,31 @@
 #compdef cygcheck cygcheck.exe
-#Generated by Felix Rosencrantz
 
-local context state line
+# cygwin 1.5.25
+
+local curcontext="$curcontext" state line expl
 typeset -A opt_args
-_arguments  \
-  '(--check-setup --help -c -h)'{-c,--check-setup}'[check packages installed via setup.exe]' \
-  '(--keycheck --sysinfo -k -s)'{-s,--sysinfo}'[system information (not with -k)]' \
-  '(--verbose -v)'{-v,--verbose}'[verbose output (indented) (for -s or programs)]' \
-  '(--registry -r)'{-r,--registry}'[registry search (requires -s)]' \
-  '(--keycheck --sysinfo -k -s)'{-k,--keycheck}'[perform a keyboard check session (not with -s)]' \
-  '(--check-setup --help -c -h)'{-h,--help}'[give help about the info (not with -c)]' \
-  '(--version -V)'{-V,--version}'[output version information and exit]' \
-  '*:program: _command_names -e:*::program arguments: _normal'
+
+local -a exclusive_opts
+exclusive_opts=(-k --keycheck -f --find-package -l --list-package -p --package-query -h --help -V --version)
+
+_arguments -C -s -S \
+  "(* $exclusive_opts -c --check-setup)"{-c,--check-setup}'[show installed version of the specified package and verify integrity (or for all installed packages if none specified)]:*:package:->package' \
+  "(* $exclusive_opts -d --dump-only)"{-d,--dump-only}'[just list packages, do not verify (with -c)]' \
+  "(* $exclusive_opts -s --sysinfo)"{-s,--sysinfo}'[produce diagnostic system information (implies -c -d)]' \
+  "(* $exclusive_opts -r --registry)"{-r,--registry}'[also scan registry for Cygwin settings (with -s)]' \
+  '(* -)'{-k,--keycheck}'[perform a keyboard check session (must be run from a plain console only, not from a pty/rxvt/xterm)]' \
+  '(* -)'{-f,--find-package}'[find the package that specified file belongs to]:*:file:_files' \
+  '(* -)'{-l,--list-package}'[list contents of the specified package (or all packages if none given)]:*:package:->package' \
+  '(* -)'{-p,--package-query}'[search for the specified regexp in the entire cygwin.com package repository (requires internet connectivity)]:regexp:' \
+  '(-V --version -k --keycheck -f --find-package -l --list-package -p --package-query -c --check-setup -d --dump-only -v --verbose)'{-v,--verbose}'[produce more verbose output]' \
+  '(-V --version -k --keycheck -f --find-package -l --list-package -p --package-query -c --check-setup -d --dump-only -h --help)'{-h,--help}'[annotate output with explanatory comments when given with another command, otherwise print this help]' \
+  '(* -)'{-V,--version}'[print the version of cygcheck and exit]' \
+  '(-)*:program: _command_names -e' && return
+
+if [[ "$state" = package ]]; then
+  local -a packages
+  packages=( ${${${(f)"$(_call_program packages $words[1] -c -d)"}[3,-1]}%% *} )
+  _wanted packages expl package compadd -a packages && return
+fi
+
+return 1