1#compdef dlocate
2
3local context state line
4typeset -A opt_args
5
6_arguments \
7	'-h[help]' \
8	'-S[match strings only]' \
9	'-L[list all files in package]' \
10	'-l[almost-emulation of dpkg -l]' \
11	'-s[print status of package]' \
12	'-ls[ls -ldF of all files in package]' \
13	'-du[du -sck of all files in package]' \
14        '-conf[list conffiles in package]' \
15	'-lsconf[ls -ldF of conffiles in package]' \
16	'-lsman[list man pages in package]' \
17	'-lsbin[list executable files in package]' \
18	'-md5sum[list md5sums (if any) of package]' \
19	'-md5check[check md5sums (if any) of package]' \
20	'-man[list man pages (if any) of package]' \
21	':arg:->stringorpkg' && return 0
22
23case "$state" in
24    (stringorpkg)
25      if (( $+opt_args[-S] )); then
26          _files
27      else
28          _alternative \
29		'string:search string:_files' \
30		'package:Debian packages:_deb_packages installed'
31      fi
32    ;;
33esac
34