# BEGIN Debian Tcsh Rules 
#
# MODIFIED: $Date: 2001/12/31 13:40:28 $ GMT
# AUTHOR:   Neil W. Van Dyke <nwv@neilvandyke.org>
# WEB PAGE: http://www.neilvandyke.org/debian-tcsh/
# LICENSE:  GPL
#
# HISTORY:  21-Dec-2001 First release.
#           22-Dec-2001 Added apt-cdrom, deborphan, dpkg-deb, and dselect.
#                       Reworked the rest of the rules.
#           24-Dec-2001 Added make-kpkg, /etc/init.d/*.
#           31-Dec-2001 Added apt-listchanges, deb-make, debchange (dch), 
#                       debuild, dpkg-architecture.

complete apt-cache \
  p/1/'(add depends dotty dump dumpavail gencaches pkgnames policy search \
        show showpkg stats unmet)'/ \
  c/-o=/x:'<config_string>'/ \
  c/--/'(all-names all-versions config-file full generate help important \
         names-only option pkg-cache quiet recurse src-cache version)'/ \
  c/-/'(- a c f g h i o= p q s v)'/ \
  n/search/x:'<regexp>'/ \
  n/\*/'`apt-cache pkgnames`'/

complete apt-cdrom \
  c/-{-cdrom,d}=/d/ \
  c/-{-config-file,c}=/f/ \
  c/-{-option,o}=/x:'<config_string>'/ \
  c/--/'(cdrom= config-file= fast help just-print no-act no-mount option= \
         recon rename thorough version)'/ \
  c/-/'(- a c= d= f h m n o= r v)'/ \
  n/\*/'(add ident)'/
  
complete apt-get \
  p/1/'(autoclean build-dep check clean dist-upgrade dselect-upgrade install \
        remove source update upgrade)'/ \
  c/-c=/f/ \
  c/-o=/x:'<config_string>'/ \
  c/--/'(assume-yes build compile config-file default-release diff-only \
         download-only dry-run fix-broken fix-missing force-yes help \
         ignore-hold ignore-missing just-print list-cleanup no-act \
         no-download no-remove no-upgrade only-source option print-uris purge \
         quiet recon reinstall show-upgraded simulate tar-only target-release \
         trivial-only version yes)'/ \
  c/-/'(- b c= d f h m o= q s t u v y)'/ \
  n/\*/'`apt-cache pkgnames`'/

complete apt-listchanges \
  c/--email-address=/x:'<string>'/ \
  c/-{-frontend,f}=/'(mail newt pager text xterm-pager)'/ \
  c/--/'(all confirm debug email-address= headers help noconfirm nosaveseen \
         saveseen verbose version)'/ \
  c/-/'(- a c f h v)'/ \
  n/\*/f:\*.deb/

complete {dch,debchange} \
  n/-{-newversion,v}/x:'<version>'/ \
  c/--/'(append help increment newversion preserve version)'/ \
  c/-/'(- a h i p v)'/ \
  n/\*/x:'<text>'/

complete deb-make \
  p/1/'(native)'/

complete deborphan \
  c/--priority=/'(extra important optional required standard 1 2 3 4 5)'/ \
  c/--\*=/f/ \
  c/--/'(add-keep all-packages del-keep df-keep force-hold guess-all \
         guess-debug guess-dev guess-only guess-perl guess-section help \
         keep-file= list-keep nice-mode no-df-keep no-show-section priority= \
         show-deps show-priority show-section status-file= version)'/ \
  c/-/'(- A H L P R a d f h k n p s v)'// \
  n/\*/'`apt-cache pkgnames`'/

complete debuild \
  n/-{-preserve-envvar,e}/ \
  c/-{-rootcmd=,r}/'(fakeroot sudo super)'/ \
  c/--/'(allow-root lintian no-lintian preserve-env preserve-envvar \
         rootcmd=)'/ \
  c/-/'(- E L e r)'/ \
  n/\*/'(binary binary-arch binary-indep clean)'/

complete dlocate \
  c/-/'(L S conf du h l ls lsconf man md5check md5sum s)'/ \
  n/-S/x:'<string>'/ \
  n/\*/'`apt-cache pkgnames`'/

complete dpkg \
  c/--abort-after=/x:'<number>'/ \
  c/--ignore-depends=\*,/'`apt-cache pkgnames`'/ \
  c/--ignore-depends=/'`apt-cache pkgnames`'/ \
  c/--{admindir,instdir,root}/d/ \
  c/--/'(abort-after= admindir= audit auto-deconfigure build clear-avail \
         command-fd compare-versions configure contents control debug \
         debug=help extract field force-all force-architecture \
         force-auto-select force-bad-path force-confdef force-configure-any \
         force-conflicts force-confnew force-confold force-depends \
         force-depends-version force-downgrade force-help force-hold \
         force-not-root force-overwrite force-overwrite-dir \
         force-overwrite-diverted force-remove-essential \
         force-remove-reinstreq forget-old-unavail fsys-tarfile \
         get-selections help ignore-depends= info install instdir= licence \
         license list listfiles merge-avail new no-act nocheck old pending \
         print-architecture print-avail print-gnu-build-architecture \
         print-installation-architecture purge record-avail recursive remove \
         root= search selected-only set-selections skip-same-version status \
         status-fd unpack update-avail vextract yet-to-unpack)'/ \
  c/-/'(- A B C D Dh E G I L O P R S X b c e f i l p r s x)'/ \
  n/-{-configure,-purge,-remove,-status,P,r,s}/'`apt-cache pkgnames`'/ \
  n/-{-list-files,-status,L,s}/'`apt-cache pkgnames`'/ \
  n/-{-print-avail,p}/'`apt-cache pkgnames`'/ \
  n/-{-install,-record-avail,-unpack,A,i}/f:\*.deb/ \
  n/-{-build,b}/d/ \
  n/-{-control,-extract,-vextract,X,e,x}/f:\*.deb/ \
  N/-{-control,-extract,-vextract,X,e,x}/d/ \
  n/-{-contents,-fsys-tarfile,c}/f:\*.deb/ \
  n/-{-field,f}/f:\*.deb/ \
  N/-{-field,f}/'(Architecture Conflicts Depends Description Essential \
                  Maintainer Package Pre-Depends Priority Provides Recommends \
                  Replaces Section Source Suggests Version)'/ \
  n/-{-info,I}/f:\*.deb/ \
  N/--compare-versions/'(eq ge ge-nl gt gt-nl le le-nl lt lt-nl ne)'/

complete dpkg-architecture \
  c/-a/x:'<debian_architecture>'/ \
  n/-c/x:'<command>'/ \
  c/-q/'(DEB_BUILD_ARCH DEB_BUILD_GNU_CPU DEB_BUILD_GNU_SYSTEM \
         DEB_BUILD_GNU_TYPE DEB_HOST_ARCH DEB_HOST_GNU_CPU \
         DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE)'/ \
  c/-t/x:'<gnu_system_type>'/ \
  c/-{c,f,l,s,u}/n/' '/ \
  c/-/'(a c f l q s t u)'/

complete dpkg-deb \
  c/--/'(build contents control debug extract field fsys-tarfile help info \
         licence license new nocheck old version vextract)'/ \
  c/-/'(- D I X b c e f h x)'/ \
  n/-{-build,b}/d/ \
  N/-{-build,b}/f/ \
  N/--control/d/ \
  N/-{-info,I}/f/ \
  N/-{-extract,-vextract,X,x}/d/ \
  N/-{-field,f}/'(Architecture Conflicts Depends Description Essential \
                  Maintainer Package Pre-Depends Priority Provides Recommends \
                  Replaces Section Source Suggests Version)'/ \
  p/1/'(-)'// \
  n/\*/f:\*.deb/

complete dpkg-divert \
  c/--/'(add admindir divert help list local package quiet remove rename test \
         truename version)'/ \
  n/--admindir/d/ \
  n/--list/x:'<glob_pattern>'/ \
  n/--package/'`apt-cache pkgnames`'/ \
  n/\*/f/

complete dselect \
  c/-D/f/ \
  c/--/'(admindir debug expert help licence license version)'/ \
  c/-/'(- D)'/ \
  n/--admindir/d/ \
  n/--debug/f/ \
  n/\*/'(Access Config Install Quit Remove Select Update)'/

complete make-kpkg \
  c/--added-modules=\*,/f/ \
  c/--added-modules=/f/ \
  c@--added-patches=@'`sh -c "cd /usr/src/kernel-patches && /bin/ls"`'@ \
  c@--arch=@'`sh -c "cd /usr/lib/gcc-lib && /bin/ls"`'@ \
  c/--{append-to-version,flavour}=/x:'<foo>'/ \
  c/--cross-compile=/x:'<target_string>'/ \
  c/--pgpsign=/x:'<string>'/ \
  c/--revision=/'(1.00.Custom)'/ \
  c/--subarch=/x:'<subarchitecture>'/ \
  c/--/'(added-modules= added-patches= append-to-version= arch= arch-in-name \
         bzimage config cross-compile= flavour= help initrd noexec pgpsign= \
         revision= rootcmd subarch= targets uc us zimage)'/ \
  c/-/'(-)'// \
  n/\*/'(binary build buildpackage clean configure debian kernel_doc \
         kernel_headers kernel_image kernel_source libc-kheaders modules \
         modules_clean modules_config modules_image)'/

complete /etc/init.d/\* \
  p/1/'(force-reload reload restart start stop)'/

# END Debian Tcsh Rules
