159243Sobrien#
2232633Smp# $tcsh: complete.tcsh,v 1.52 2010/05/07 17:54:13 christos Exp $
359243Sobrien# example file using the new completion code
459243Sobrien#
5131962Smp# Debian GNU/Linux
6131962Smp# /usr/share/doc/tcsh/examples/complete.gz
7131962Smp#
8145479Smp# This file may be read from user's ~/.cshrc or ~/.tcshrc file by
9131962Smp# decompressing it into the home directory as ~/.complete and
10131962Smp# then adding the line "source ~/.complete" and maybe defining
11131962Smp# some of the shell variables described below.
12131962Smp#
13131962Smp# Added two Debian-specific completions: dpkg and dpkg-deb (who
14131962Smp# wrote them?). Changed completions of several commands. The ones
15131962Smp# are evaluated if the `traditional_complete' shell variable is
16131962Smp# defined.
17131962Smp#
18131962Smp# Debian enhancements by Vadim Vygonets <vadik@cs.huji.ac.il>.
19131962Smp# Bugfixes and apt completions by Miklos Quartus <miklos.quartus@nokia.com>.
20131962Smp# Cleanup by Martin A. Godisch <martin@godisch.de>.
2159243Sobrien
2259243Sobrienonintr -
2359243Sobrienif (! $?prompt) goto end
2459243Sobrien
2559243Sobrienif ($?tcsh) then
2659243Sobrien    if ($tcsh != 1) then
2759243Sobrien   	set rev=$tcsh:r
2859243Sobrien	set rel=$rev:e
2959243Sobrien	set pat=$tcsh:e
3059243Sobrien	set rev=$rev:r
3159243Sobrien    endif
3259243Sobrien    if ($rev > 5 && $rel > 1) then
3383098Smp	set _complete=1
3459243Sobrien    endif
3559243Sobrien    unset rev rel pat
3659243Sobrienendif
3759243Sobrien
3883098Smpif ($?_complete) then
3959243Sobrien    set noglob
40100616Smp    if ( ! $?hosts ) set hosts
41195609Smp    foreach f ("$HOME/.hosts" /usr/local/etc/csh.hosts "$HOME/.rhosts" /etc/hosts.equiv)
42195609Smp        if ( -r "$f" ) then
43195609Smp	    set hosts = ($hosts `grep -v "+" "$f" | grep -E -v "^#" | tr -s " " "	" | cut -f 1`)
4459243Sobrien	endif
4559243Sobrien    end
46195609Smp    if ( -r "$HOME/.netrc" ) then
47195609Smp	set f=`awk '/machine/ { print $2 }' < "$HOME/.netrc"` >& /dev/null
4859243Sobrien	set hosts=($hosts $f)
4959243Sobrien    endif
50195609Smp    if ( -r "$HOME/.ssh/known_hosts" ) then
51195609Smp	set f=`cat "$HOME/.ssh/known_hosts" | cut -f 1 -d \ ` >& /dev/null
52195609Smp	set f=`cat "$HOME/.ssh/known_hosts" | cut -f 1 -d \ | sed -e 's/,/ /g'` >& /dev/null
53100616Smp	set hosts=($hosts $f)
54100616Smp    endif
5559243Sobrien    unset f
5659243Sobrien    if ( ! $?hosts ) then
5759243Sobrien	set hosts=(hyperion.ee.cornell.edu phaeton.ee.cornell.edu \
5859243Sobrien		   guillemin.ee.cornell.edu vangogh.cs.berkeley.edu \
5959243Sobrien		   ftp.uu.net prep.ai.mit.edu export.lcs.mit.edu \
6059243Sobrien		   labrea.stanford.edu sumex-aim.stanford.edu \
6159243Sobrien		   tut.cis.ohio-state.edu)
6259243Sobrien    endif
6359243Sobrien
6459243Sobrien    complete ywho  	n/*/\$hosts/	# argument from list in $hosts
6559243Sobrien    complete rsh	p/1/\$hosts/ c/-/"(l n)"/   n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
6659243Sobrien    complete ssh	p/1/\$hosts/ c/-/"(l n)"/   n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
6759243Sobrien    complete xrsh	p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
6859243Sobrien    complete rlogin 	p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/
6959243Sobrien    complete telnet 	p/1/\$hosts/ p/2/x:'<port>'/ n/*/n/
7059243Sobrien
7159243Sobrien    complete cd  	p/1/d/		# Directories only
7259243Sobrien    complete chdir 	p/1/d/
7359243Sobrien    complete pushd 	p/1/d/
7459243Sobrien    complete popd 	p/1/d/
7559243Sobrien    complete pu 	p/1/d/
7659243Sobrien    complete po 	p/1/d/
7759243Sobrien    complete complete 	p/1/X/		# Completions only
7859243Sobrien    complete uncomplete	n/*/X/
7959243Sobrien    complete exec 	p/1/c/		# Commands only
8059243Sobrien    complete trace 	p/1/c/
8159243Sobrien    complete strace 	p/1/c/
8259243Sobrien    complete which	n/*/c/
8359243Sobrien    complete where	n/*/c/
8459243Sobrien    complete skill 	p/1/c/
8559243Sobrien    complete dde	p/1/c/ 
8659243Sobrien    complete adb	c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
8759243Sobrien    complete sdb	p/1/c/
8859243Sobrien    complete dbx	c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
8959243Sobrien    complete xdb	p/1/c/
9059243Sobrien    complete gdb	n/-d/d/ n/*/c/
9159243Sobrien    complete ups	p/1/c/
9259243Sobrien    complete set	'c/*=/f/' 'p/1/s/=' 'n/=/f/'
9359243Sobrien    complete unset	n/*/s/
9459243Sobrien    complete alias 	p/1/a/		# only aliases are valid
9559243Sobrien    complete unalias	n/*/a/
9659243Sobrien    complete xdvi 	n/*/f:*.dvi/	# Only files that match *.dvi
9759243Sobrien    complete dvips 	n/*/f:*.dvi/
98145479Smp    if ($?traditional_complete) then
99145479Smp        complete tex 	n/*/f:*.tex/	# Only files that match *.tex
100145479Smp    else
101145479Smp        complete tex 	n/*/f:*.{tex,texi}/	# Files that match *.tex and *.texi
102145479Smp    endif
10359243Sobrien    complete latex 	n/*/f:*.{tex,ltx}/
10459243Sobrien    complete su		c/--/"(login fast preserve-environment command shell \
10559243Sobrien			help version)"/	c/-/"(f l m p c s -)"/ \
10659243Sobrien			n/{-c,--command}/c/ \
10759243Sobrien			n@{-s,--shell}@'`cat /etc/shells`'@ n/*/u/
10859243Sobrien    complete cc 	c/-[IL]/d/ \
10959243Sobrien              c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
11059243Sobrien			c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
11159243Sobrien    complete acc 	c/-[IL]/d/ \
11259243Sobrien       c@-l@'`\ls -1 /usr/lang/SC1.0/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
11359243Sobrien			c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
11459243Sobrien    complete gcc 	c/-[IL]/d/ \
11559243Sobrien		 	c/-f/"(caller-saves cse-follow-jumps delayed-branch \
11659243Sobrien		               elide-constructors expensive-optimizations \
11759243Sobrien			       float-store force-addr force-mem inline \
11859243Sobrien			       inline-functions keep-inline-functions \
11959243Sobrien			       memoize-lookups no-default-inline \
12059243Sobrien			       no-defer-pop no-function-cse omit-frame-pointer \
12159243Sobrien			       rerun-cse-after-loop schedule-insns \
12259243Sobrien			       schedule-insns2 strength-reduce \
12359243Sobrien			       thread-jumps unroll-all-loops \
12459243Sobrien			       unroll-loops syntax-only all-virtual \
12559243Sobrien			       cond-mismatch dollars-in-identifiers \
12659243Sobrien			       enum-int-equiv no-asm no-builtin \
12759243Sobrien			       no-strict-prototype signed-bitfields \
12859243Sobrien			       signed-char this-is-variable unsigned-bitfields \
12959243Sobrien			       unsigned-char writable-strings call-saved-reg \
13059243Sobrien			       call-used-reg fixed-reg no-common \
13159243Sobrien			       no-gnu-binutils nonnull-objects \
13259243Sobrien			       pcc-struct-return pic PIC shared-data \
13359243Sobrien			       short-enums short-double volatile)"/ \
13459243Sobrien		 	c/-W/"(all aggregate-return cast-align cast-qual \
13559243Sobrien		      	       comment conversion enum-clash error format \
13659243Sobrien		      	       id-clash-len implicit missing-prototypes \
13759243Sobrien		      	       no-parentheses pointer-arith return-type shadow \
13859243Sobrien		      	       strict-prototypes switch uninitialized unused \
13959243Sobrien		      	       write-strings)"/ \
14059243Sobrien		 	c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd \
14159243Sobrien			       short c68000 c68020 soft-float g gnu unix fpu \
14259243Sobrien			       no-epilogue)"/ \
14359243Sobrien		 	c/-d/"(D M N)"/ \
14459243Sobrien		 	c/-/"(f W vspec v vpath ansi traditional \
14559243Sobrien			      traditional-cpp trigraphs pedantic x o l c g L \
14659243Sobrien			      I D U O O2 C E H B b V M MD MM i dynamic \
14759243Sobrien			      nodtdlib static nostdinc undef)"/ \
14859243Sobrien		 	c/-l/f:*.a/ \
14959243Sobrien		 	n/*/f:*.{c,C,cc,o,a,s,i}/
15059243Sobrien    complete g++ 	n/*/f:*.{C,cc,o,s,i}/
15169408Sache    complete CC 	n/*/f:*.{C,cc,cpp,o,s,i}/
15259243Sobrien    complete rm 	c/--/"(directory force interactive verbose \
15359243Sobrien			recursive help version)"/ c/-/"(d f i v r R -)"/ \
15459243Sobrien			n/*/f:^*.{c,cc,C,h,in}/	# Protect precious files
15559243Sobrien    complete vi 	n/*/f:^*.[oa]/
15659243Sobrien    complete bindkey    N/-a/b/ N/-c/c/ n/-[ascr]/'x:<key-sequence>'/ \
15759243Sobrien			n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/\
15859243Sobrien			n/-k/"(left right up down)"/ p/2-/b/ \
15959243Sobrien			p/1/'x:<key-sequence or option>'/
16059243Sobrien
16159243Sobrien    complete find 	n/-fstype/"(nfs 4.2)"/ n/-name/f/ \
16259243Sobrien		  	n/-type/"(c b d f p l s)"/ n/-user/u/ n/-group/g/ \
16359243Sobrien			n/-exec/c/ n/-ok/c/ n/-cpio/f/ n/-ncpio/f/ n/-newer/f/ \
16459243Sobrien		  	c/-/"(fstype name perm prune type user nouser \
16559243Sobrien		  	     group nogroup size inum atime mtime ctime exec \
16659243Sobrien			     ok print ls cpio ncpio newer xdev depth \
16759243Sobrien			     daystart follow maxdepth mindepth noleaf version \
16859243Sobrien			     anewer cnewer amin cmin mmin true false uid gid \
16959243Sobrien			     ilname iname ipath iregex links lname empty path \
17059243Sobrien			     regex used xtype fprint fprint0 fprintf \
17159243Sobrien			     print0 printf not a and o or)"/ \
17259243Sobrien			     n/*/d/
17359243Sobrien
17459243Sobrien    complete -%*	c/%/j/			# fill in the jobs builtin
17559243Sobrien    complete {fg,bg,stop}	c/%/j/ p/1/"(%)"//
17659243Sobrien
17759243Sobrien    complete limit	c/-/"(h)"/ n/*/l/
17859243Sobrien    complete unlimit	c/-/"(h)"/ n/*/l/
17959243Sobrien
18059243Sobrien    complete -co*	p/0/"(compress)"/	# make compress completion
18159243Sobrien						# not ambiguous
182145479Smp    if ($?traditional_complete) then
183145479Smp        complete zcat	n/*/f:*.Z/
184145479Smp    else
185145479Smp        # "zcat" may be linked to "compress" or "gzip"
186145479Smp        if (-X zcat) then
187145479Smp            zcat --version >& /dev/null
188145479Smp            if ($status != 0) then
189145479Smp                complete zcat	n/*/f:*.Z/
190145479Smp            else
191145479Smp                complete zcat	c/--/"(force help license quiet version)"/ \
192131962Smp				c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
193145479Smp	    endif
194145479Smp        endif
195131962Smp    endif
19659243Sobrien
19759243Sobrien    complete finger	c/*@/\$hosts/ n/*/u/@ 
19859243Sobrien    complete ping	p/1/\$hosts/
19959243Sobrien    complete traceroute	p/1/\$hosts/
20059243Sobrien
20159243Sobrien    complete {talk,ntalk,phone}	p/1/'`users | tr " " "\012" | uniq`'/ \
20259243Sobrien		n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/
20359243Sobrien
20459243Sobrien    complete ftp	c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/
20559243Sobrien
20659243Sobrien    # this one is simple...
20759243Sobrien    #complete rcp c/*:/f/ C@[./\$~]*@f@ n/*/\$hosts/:
20859243Sobrien    # From Michael Schroeder <mlschroe@immd4.informatik.uni-erlangen.de> 
20959243Sobrien    # This one will rsh to the file to fetch the list of files!
21059243Sobrien    complete rcp 'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");rsh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");rsh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@'  'n/*/$hosts/:'
21159243Sobrien
21259243Sobrien    complete dd c/--/"(help version)"/ c/[io]f=/f/ \
21359243Sobrien		c/conv=*,/"(ascii ebcdic ibm block unblock \
21459243Sobrien			    lcase notrunc ucase swab noerror sync)"/,\
21559243Sobrien		c/conv=/"(ascii ebcdic ibm block unblock \
21659243Sobrien			  lcase notrunc ucase swab noerror sync)"/,\
21759243Sobrien	        c/*=/x:'<number>'/ \
21859243Sobrien		n/*/"(if of conv ibs obs bs cbs files skip file seek count)"/=
21959243Sobrien
22059243Sobrien    complete nslookup   p/1/x:'<host>'/ p/2/\$hosts/
22159243Sobrien
22259243Sobrien    complete ar c/[dmpqrtx]/"(c l o u v a b i)"/ p/1/"(d m p q r t x)"// \
22359243Sobrien		p/2/f:*.a/ p/*/f:*.o/
22459243Sobrien
22559243Sobrien    # these should be merged with the MH completion hacks below - jgotts
226131962Smp    complete {refile,sprev,snext,scan,pick,rmm,inc,folder,show} \
227195609Smp		"c@+@F:$HOME/Mail/@"
22859243Sobrien
22959243Sobrien    # these and interrupt handling from Jaap Vermeulen <jaap@sequent.com>
23059243Sobrien    complete {rexec,rxexec,rxterm,rmterm} \
23159243Sobrien			'p/1/$hosts/' 'c/-/(l L E)/' 'n/-l/u/' 'n/-L/f/' \
23259243Sobrien			'n/-E/e/' 'n/*/c/'
23359243Sobrien    complete kill	'c/-/S/' 'c/%/j/' \
23459243Sobrien			'n/*/`ps -u $LOGNAME | awk '"'"'{print $1}'"'"'`/'
23559243Sobrien
23659243Sobrien    # these from Marc Horowitz <marc@cam.ov.com>
23759243Sobrien    complete attach 'n/-mountpoint/d/' 'n/-m/d/' 'n/-type/(afs nfs rvd ufs)/' \
23859243Sobrien		    'n/-t/(afs nfs rvd ufs)/' 'n/-user/u/' 'n/-U/u/' \
23959243Sobrien		    'c/-/(verbose quiet force printpath lookup debug map \
24059243Sobrien			  nomap remap zephyr nozephyr readonly write \
24159243Sobrien			  mountpoint noexplicit explicit type mountoptions \
24259243Sobrien			  nosetuid setuid override skipfsck lock user host)/' \
24359243Sobrien		    'n/-e/f/' 'n/*/()/'
24459243Sobrien    complete hesinfo	'p/1/u/' \
24559243Sobrien			'p/2/(passwd group uid grplist pcap pobox cluster \
24659243Sobrien			      filsys sloc service)/'
24759243Sobrien
24859243Sobrien    # these from E. Jay Berkenbilt <ejb@ERA.COM>
24959243Sobrien    # = isn't always followed by a filename or a path anymore - jgotts
250145479Smp    if ($?traditional_complete) then
251145479Smp        complete ./configure \
252145479Smp			 'c/--*=/f/' 'c/--{cache-file,prefix,exec-prefix,\
25359243Sobrien    				bindir,sbindir,libexecdir,datadir,\
25459243Sobrien				sysconfdir,sharedstatedir,localstatedir,\
25559243Sobrien				libdir,includedir,oldincludedir,infodir,\
25659243Sobrien				mandir,srcdir}/(=)//' \
25759243Sobrien			 'c/--/(cache-file verbose prefix exec-prefix bindir \
25859243Sobrien			 	sbindir libexecdir datadir sysconfdir \
25959243Sobrien				sharedstatedir localstatedir libdir \
26059243Sobrien				includedir oldincludedir infodir mandir \
26159243Sobrien				srcdir)//'
262145479Smp    else
263131962Smp	complete ./configure \
264131962Smp			'c@--{prefix,exec-prefix,bindir,sbindir,libexecdir,datadir,sysconfdir,sharedstatedir,localstatedir,infodir,mandir,srcdir,x-includes,x-libraries}=*@x:<directory e.g. /usr/local>'@ \
265131962Smp 			'c/--cachefile=*/x:<filename>/' \
266131962Smp  			'c/--{enable,disable,with}-*/x:<feature>//' \
267131962Smp 			'c/--*=/x:<directory>//' \
268131962Smp  			'c/--/(prefix= exec-prefix= bindir= \
269131962Smp			sbindir= libexecdir= datadir= sysconfdir= \
270131962Smp   			sharedstatedir= localstatedir= infodir= \
271131962Smp			mandir= srcdir= x-includes= x-libraries= cachefile= \
272131962Smp 			enable- disable- with- \
273131962Smp 			help no-create quiet silent version verbose )//'
274145479Smp    endif
27559243Sobrien    complete gs 'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc \
27659243Sobrien			      dfaxhigh dfaxlow laserjet ljet4 sparc pbm \
27759243Sobrien			      pbmraw pgm pgmraw ppm ppmraw bit)/' \
27859243Sobrien		'c/-sOutputFile=/f/' 'c/-s/(DEVICE OutputFile)/=' \
27959243Sobrien		'c/-d/(NODISPLAY NOPLATFONTS NOPAUSE)/' 'n/*/f/'
28059243Sobrien    complete perl	'n/-S/c/'
28159243Sobrien    complete printenv	'n/*/e/'
28259243Sobrien    complete sccs	p/1/"(admin cdc check clean comb deledit delget \
28359243Sobrien			delta diffs edit enter fix get help info \
28459243Sobrien			print prs prt rmdel sccsdiff tell unedit \
28559243Sobrien			unget val what)"/
28659243Sobrien    complete setenv	'p/1/e/' 'c/*:/f/'
28759243Sobrien
28859243Sobrien    # these and method of setting hosts from Kimmo Suominen <kim@tac.nyc.ny.us>
289195609Smp    if ( -f "$HOME/.mh_profile" && -x "`which folders`" ) then 
29059243Sobrien
29159243Sobrien    if ( ! $?FOLDERS ) setenv FOLDERS "`folders -fast -recurse`"
29259243Sobrien    if ( ! $?MHA )     setenv MHA     "`ali | sed -e '/^ /d' -e 's/:.*//'`"
29359243Sobrien
29459243Sobrien    set folders = ( $FOLDERS )
29559243Sobrien    set mha = ( $MHA )
29659243Sobrien
29759243Sobrien    complete ali \
29859243Sobrien        'c/-/(alias nolist list nonormalize normalize nouser user help)/' \
29959243Sobrien        'n,-alias,f,'
30059243Sobrien
30159243Sobrien    complete anno \
30259243Sobrien        'c/-/(component noinplace inplace nodate date text help)/' \
30359243Sobrien        'c,+,$folders,'  \
30459243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
30559243Sobrien
30659243Sobrien    complete burst \
30759243Sobrien        'c/-/(noinplace inplace noquiet quiet noverbose verbose help)/' \
30859243Sobrien        'c,+,$folders,'  \
30959243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
31059243Sobrien
31159243Sobrien    complete comp \
31259243Sobrien        'c/-/(draftfolder draftmessage nodraftfolder editor noedit file form nouse use whatnowproc nowhatnowproc help)/' \
31359243Sobrien        'c,+,$folders,'  \
31459243Sobrien        'n,-whatnowproc,c,'  \
31559243Sobrien        'n,-file,f,'\
31659243Sobrien        'n,-form,f,'\
31759243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
31859243Sobrien
31959243Sobrien    complete dist \
32059243Sobrien        'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit form noinplace inplace whatnowproc nowhatnowproc help)/' \
32159243Sobrien        'c,+,$folders,'  \
32259243Sobrien        'n,-whatnowproc,c,'  \
32359243Sobrien        'n,-form,f,'\
32459243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
32559243Sobrien
32659243Sobrien    complete folder \
32759243Sobrien        'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
32859243Sobrien        'c,+,$folders,'  \
32959243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
33059243Sobrien
33159243Sobrien    complete folders \
33259243Sobrien        'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
33359243Sobrien        'c,+,$folders,'  \
33459243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
33559243Sobrien
33659243Sobrien    complete forw \
33759243Sobrien        'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit filter form noformat format noinplace inplace digest issue volume whatnowproc nowhatnowproc help)/' \
33859243Sobrien        'c,+,$folders,'  \
33959243Sobrien        'n,-whatnowproc,c,'  \
34059243Sobrien        'n,-filter,f,'\
34159243Sobrien        'n,-form,f,'\
34259243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
34359243Sobrien
34459243Sobrien    complete inc \
34559243Sobrien        'c/-/(audit file noaudit nochangecur changecur file form format nosilent silent notruncate truncate width help)/' \
34659243Sobrien        'c,+,$folders,'  \
34759243Sobrien        'n,-audit,f,'\
34859243Sobrien        'n,-form,f,'
34959243Sobrien
35059243Sobrien    complete mark \
35159243Sobrien        'c/-/(add delete list sequence nopublic public nozero zero help)/' \
35259243Sobrien        'c,+,$folders,'  \
35359243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
35459243Sobrien
35559243Sobrien    complete mhmail \
35659243Sobrien        'c/-/(body cc from subject help)/' \
35759243Sobrien        'n,-cc,$mha,'  \
35859243Sobrien        'n,-from,$mha,'  \
35959243Sobrien        'n/*/$mha/'
36059243Sobrien
36159243Sobrien    complete mhpath \
36259243Sobrien        'c/-/(help)/' \
36359243Sobrien        'c,+,$folders,'  \
36459243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
36559243Sobrien
36659243Sobrien    complete msgchk \
36759243Sobrien        'c/-/(nodate date nonotify notify help)/' 
36859243Sobrien
36959243Sobrien    complete msh \
37059243Sobrien        'c/-/(prompt noscan scan notopcur topcur help)/' 
37159243Sobrien
37259243Sobrien    complete next \
37359243Sobrien        'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
37459243Sobrien        'c,+,$folders,'  \
37559243Sobrien        'n,-moreproc,c,'  \
37659243Sobrien        'n,-showproc,c,'  \
37759243Sobrien        'n,-form,f,'
37859243Sobrien
37959243Sobrien    complete packf \
38059243Sobrien        'c/-/(file help)/' \
38159243Sobrien        'c,+,$folders,'  \
38259243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
38359243Sobrien
38459243Sobrien    complete pick \
38559243Sobrien        'c/-/(and or not lbrace rbrace cc date from search subject to othercomponent after before datefield sequence nopublic public nozero zero nolist list help)/' \
38659243Sobrien        'c,+,$folders,'  \
38759243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
38859243Sobrien
38959243Sobrien    complete prev \
39059243Sobrien        'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
39159243Sobrien        'c,+,$folders,'  \
39259243Sobrien        'n,-moreproc,c,'  \
39359243Sobrien        'n,-showproc,c,'  \
39459243Sobrien        'n,-form,f,'
39559243Sobrien
39659243Sobrien    complete prompter \
39759243Sobrien        'c/-/(erase kill noprepend prepend norapid rapid nodoteof doteof help)/' 
39859243Sobrien
39959243Sobrien    complete refile \
40059243Sobrien        'c/-/(draft nolink link nopreserve preserve src file help)/' \
40159243Sobrien        'c,+,$folders,'  \
40259243Sobrien        'n,-file,f,'\
40359243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
40459243Sobrien
40559243Sobrien    complete rmf \
40659243Sobrien        'c/-/(nointeractive interactive help)/' \
40759243Sobrien        'c,+,$folders,'  
40859243Sobrien
40959243Sobrien    complete rmm \
41059243Sobrien        'c/-/(help)/' \
41159243Sobrien        'c,+,$folders,'  \
41259243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
41359243Sobrien
41459243Sobrien    complete scan \
41559243Sobrien        'c/-/(noclear clear form format noheader header width noreverse reverse file help)/' \
41659243Sobrien        'c,+,$folders,'  \
41759243Sobrien        'n,-form,f,'\
41859243Sobrien        'n,-file,f,'\
41959243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
42059243Sobrien
42159243Sobrien    complete send \
42259243Sobrien        'c/-/(alias draft draftfolder draftmessage nodraftfolder filter nofilter noformat format noforward forward nomsgid msgid nopush push noverbose verbose nowatch watch width help)/' \
42359243Sobrien        'n,-alias,f,'\
42459243Sobrien        'n,-filter,f,'
42559243Sobrien
42659243Sobrien    complete show \
42759243Sobrien        'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
42859243Sobrien        'c,+,$folders,'  \
42959243Sobrien        'n,-moreproc,c,'  \
43059243Sobrien        'n,-showproc,c,'  \
43159243Sobrien        'n,-form,f,'\
43259243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
43359243Sobrien
43459243Sobrien    complete sortm \
43559243Sobrien        'c/-/(datefield textfield notextfield limit nolimit noverbose verbose help)/' \
43659243Sobrien        'c,+,$folders,'  \
43759243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
43859243Sobrien
43959243Sobrien    complete vmh \
44059243Sobrien        'c/-/(prompt vmhproc novmhproc help)/' \
44159243Sobrien        'n,-vmhproc,c,'  
44259243Sobrien
44359243Sobrien    complete whatnow \
44459243Sobrien        'c/-/(draftfolder draftmessage nodraftfolder editor noedit prompt help)/' 
44559243Sobrien
44659243Sobrien    complete whom \
44759243Sobrien        'c/-/(alias nocheck check draft draftfolder draftmessage nodraftfolder help)/' \
44859243Sobrien        'n,-alias,f,'
44959243Sobrien
45059243Sobrien    complete plum \
45159243Sobrien        'c/-/()/' \
45259243Sobrien        'c,+,$folders,'  \
45359243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
45459243Sobrien
45559243Sobrien    complete mail \
45659243Sobrien        'c/-/()/' \
45759243Sobrien        'n/*/$mha/'
45859243Sobrien
45959243Sobrien    endif
46059243Sobrien
46159243Sobrien    #from Dan Nicolaescu <dann@ics.uci.edu>
46259243Sobrien    if ( $?MODULESHOME ) then
46361515Sobrien	alias Compl_module 'find ${MODULEPATH:as/:/ /} -name .version -o -name .modulea\* -prune -o -print  | sed `echo "-e s@${MODULEPATH:as%:%/\*@@g -e s@%}/\*@@g"`'
46459243Sobrien	complete module 'p%1%(add load unload switch display avail use unuse update purge list clear help initadd initrm initswitch initlist initclear)%' \
46561515Sobrien	'n%{unl*,sw*,inits*}%`echo "$LOADEDMODULES:as/:/ /"`%' \
46661515Sobrien	'n%{lo*,di*,he*,inita*,initr*}%`eval Compl_module`%' \
46761515Sobrien	'N%{sw*,initsw*}%`eval Compl_module`%' 'C%-%(-append)%' 'n%{use,unu*,av*}%d%' 'n%-append%d%' \
46861515Sobrien	'C%[^-]*%`eval Compl_module`%'
46959243Sobrien    endif
47059243Sobrien
47169408Sache    # from George Cox
472100616Smp    complete acroread	'p/*/f:*.{pdf,PDF}/'
47369408Sache    complete apachectl  'c/*/(start stop restart fullstatus status graceful \
47469408Sache			configtest help)/'
47569408Sache    complete appletviewer	'p/*/f:*.class/'
47669408Sache    complete bison	'c/--/(debug defines file-prefix= fixed-output-files \
47769408Sache			help name-prefix= no-lines no-parser output= \
47869408Sache			token-table verbose version yacc)/' \
47969408Sache			'c/-/(b d h k l n o p t v y V)/' 'n/-b/f/' 'n/-o/f/' \
48069408Sache			'n/-p/f/'
481145479Smp    complete bzcat	c/--/"(help test quiet verbose license version)"/ \
482145479Smp			c/-/"(h t L V -)"/ n/*/f:*.{bz2,tbz}/
483145479Smp    complete bunzip2	c/--/"(help keep force test stdout quiet verbose \
484145479Smp                        license version)"/ c/-/"(h k f t c q v L V -)"/ \
485145479Smp			n/*/f:*.{bz2,tbz}/
486145479Smp    complete bzip2	c/--/"(help decompress compress keep force test \
487145479Smp			stdout quiet verbose license version small)"/ \
488145479Smp			c/-/"(h d z k f t c q v L V s 1 2 3 4 5 6 7 8 9 -)"/ \
489145479Smp			n/{-d,--decompress}/f:*.{bz2,tbz}/ \
490145479Smp			N/{-d,--decompress}/f:*.{bz2,tbz}/ n/*/f:^*.{bz2,tbz}/
49169408Sache    complete c++	'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
49269408Sache    complete co		'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
49369408Sache    complete crontab	'n/-u/u/'
49469408Sache    complete camcontrol	'p/1/(cmd debug defects devlist eject inquiry \
49569408Sache			modepage negotiate periphlist rescan reset start \
49669408Sache			stop tags tur)/'
49769408Sache    complete ctlinnd	'p/1/(addhist allow begin cancel changegroup \
49869408Sache			checkfile drop feedinfo flush flushlogs go hangup \
49969408Sache			logmode mode name newgroup param pause readers refile \
50069408Sache			reject reload renumber reserve rmgroup send shutdown \
50169408Sache			kill throttle trace xabort xexec)/'
50269408Sache    complete cvs	'c/--/(help help-commands help-synonyms)/' \
50369408Sache			'p/1/(add admin annotate checkout commit diff \
50469408Sache			edit editors export history import init log login \
50569408Sache			logout rdiff release remove rtag status tag unedit \
50669408Sache			update watch watchers)/' 'n/-a/(edit unedit commit \
50769408Sache			all none)/' 'n/watch/(on off add remove)/'
508195609Smp    complete svn 	'C@file:///@`'"${HOME}/etc/tcsh/complete.d/svn"'`@@' \
509195609Smp			'n@ls@(file:/// svn+ssh:// svn://)@@' \
510195609Smp			'n@help@(add blame cat checkout \
511195609Smp			cleanup commit copy delete export help \
512195609Smp			import info list ls lock log merge mkdir \
513195609Smp			move propdel propedit propget proplist \
514195609Smp			propset resolved revert status switch unlock \
515195609Smp			update)@' 'p@1@(add blame cat checkout \
516195609Smp			cleanup commit copy delete export help \
517195609Smp			import info list ls lock log merge mkdir \
518195609Smp			move propdel propedit propget proplist \
519195609Smp			propset resolved revert status switch unlock \
520195609Smp			update)@'
52169408Sache    complete cxx	'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
52269408Sache    complete detex	'p/*/f:*.tex/'
52369408Sache    complete edquota    'n/*/u/'
52469408Sache    complete exec	'p/1/c/'
52569408Sache    complete ghostview	'p/*/f:*.ps/'
52669408Sache    complete gv		'p/*/f:*.ps/'
52769408Sache    complete ifconfig	'p@1@`ifconfig -l`@' 'n/*/(range phase link netmask \
52869408Sache			mtu vlandev vlan metric mediaopt down delete \
52969408Sache			broadcast arp debug)/'
53069408Sache    complete imake	'c/-I/d/'
53169408Sache    complete ipfw 	'p/1/(flush add delete list show zero)/' \
53269408Sache			'n/add/(allow permit accept pass deny drop reject \
53369408Sache			reset count skipto num divert port tee port)/'
53469408Sache    complete javac	'p/*/f:*.java/'
53569408Sache    complete ldif2ldbm	'n/-i/f:*.ldif/'
53669408Sache    complete libtool	'c/--mode=/(compile execute finish install link \
53769408Sache			uninstall)/' 'c/--/(config debug dry-run features \
53869408Sache			finish help quiet silent version mode=)/'
53969408Sache    complete libtoolize	'c/--/(automake copy debug dry-run force help ltdl \
54069408Sache			ltdl-tar version)/'
54169408Sache    complete links	'c/-/(assume-codepage async-dns download-dir \
54269408Sache			format-cache-size ftp-proxy help http-proxy \
54369408Sache			max-connections max-connections-to-host \
54469408Sache			memory-cache-size receive-timeout retries \
54569408Sache			unrestartable-receive-timeout version)/'
54669408Sache    complete natd	c/-/'(alias_address config deny_incoming dynamic \
54769408Sache			inport interface log log_denied log_facility \
54869408Sache			outport outport port pptpalias proxy_only \
54969408Sache			proxy_rule redirect_address redirect_port \
55069408Sache			reverse same_ports unregistered_only use_sockets \
55169408Sache			verbose)'/ 'n@-interface@`ifconfig -l`@'
55269408Sache    complete netstat	'n@-I@`ifconfig -l`@'
55369408Sache    complete objdump	'c/--/(adjust-vma= all-headers architecture= \
55469408Sache			archive-headers debugging demangle disassemble \
55569408Sache			disassemble-all disassemble-zeroes dynamic-reloc \
55669408Sache			dynamic-syms endian= file-headers full-contents \
55769408Sache			headers help info line-numbers no-show-raw-insn \
55869408Sache			prefix-addresses private-headers reloc section-headers \
55969408Sache			section=source stabs start-address= stop-address= \
56069408Sache			syms target= version wide)/' \
56169408Sache			'c/-/(a h i f C d D p r R t T x s S l w)/'
56269408Sache    complete xmodmap	'c/-/(display help grammar verbose quiet n e pm pk \
56369408Sache			pke pp)/'
56469408Sache    complete lynx	'c/-/(accept_all_cookies anonymous assume_charset= \
56569408Sache			assume_local_charset= assume_unrec_charset= auth= base \
56669408Sache			book buried_news cache= case cfg= child cookie_file= \
56769408Sache			cookies core crawl debug_partial display= dump editor= \
56869408Sache			emacskeys enable_scrollback error_file= force_html \
56969408Sache			force_secure forms_options from ftp get_data head help \
57069408Sache			hiddenlinks= historical homepage= image_links index= \
57169408Sache			ismap link= localhost mime_header minimal \
57269408Sache			newschunksize= newsmaxchunk= nobrowse nocc nocolor \
57369408Sache			nofilereferer nolist nolog nopause noprint noredir \
57469408Sache			noreferer nostatus number_links partial partial_thres \
57569408Sache			pauth= popup post_data preparsed print pseudo_inlines \
57669408Sache			raw realm reload restrictions= resubmit_posts rlogin \
57769408Sache			selective show_cursor soft_dquotes source stack_dump \
57869408Sache			startfile_ok tagsoup telnet term= tlog trace traversal \
57969408Sache			underscore useragent= validate verbose version vikeys \
58069408Sache			width=)/' 'c/(http|ftp)/$URLS/'
58169408Sache    complete gmake	'c/{--directory=,--include-dir=}/d/' \
58269408Sache			'c/{--assume-new,--assume-old,--makefile,--new-file,--what-if,--file}/f/' \
58369408Sache			'c/--/(assume-new= assume-old= debug directory= \
58469408Sache			dry-run environment-overrides file= help \
58569408Sache			ignore-errors include-dir= jobs[=N] just-print \
58669408Sache			keep-going load-average[=N] makefile= max-load[=N] \
58769408Sache			new-file= no-builtin-rules no-keep-going \
58869408Sache			no-print-directory old-file= print-data-base \
58969408Sache			print-directory question quiet recon silent stop \
59069408Sache			touch version warn-undefined-variables what-if=)/' \
59169408Sache			'n@*@`cat -s GNUMakefile Makefile makefile |& sed -n -e "/No such file/d" -e "s/^\([A-Za-z0-9-]*\):.*/\1/p"`@' \
59269408Sache			'n/=/f/' 'n/-f/f/'
59369408Sache    complete mixer	p/1/'(vol bass treble synth pcm speaker mic cd mix \
59469408Sache			pcm2 rec igain ogain line1 line2 line3)'/ \
59569408Sache			p@2@'`mixer $:-1 | awk \{\ print\ \$7\ \}`'@
59669408Sache
59769408Sache    complete mpg123	'c/--/(2to1 4to1 8bit aggressive au audiodevice \
59869408Sache    			auth buffer cdr check doublespeed equalizer frames \
59969408Sache			gain halfspeed headphones left lineout list mix mono \
60069408Sache			proxy quiet random rate reopen resync right scale \
60169408Sache			shuffle single0 single1 skip speaker stdout stereo \
60269408Sache			test verbose wav)/'
60369408Sache    complete mysqladmin	'n/*/(create drop extended-status flush-hosts \
60469408Sache			flush-logs flush-status flush-tables flush-privileges \
60569408Sache			kill password ping processlist reload refresh \
60669408Sache			shutdown status variables version)/'
607195609Smp    complete mutt	"c@-f=@F:${HOME}/Mail/@" \
60869408Sache			n/-a/f/ \
60969408Sache			n/-F/f/ n/-H/f/ \
61069408Sache			n/-s/x:'<subject line>'/ \
61169408Sache			n/-e/x:'<command>'/ \
612195609Smp			n@-b@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@ \
613195609Smp			n@-c@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@ \
614195609Smp			n@*@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@
61569408Sache    complete ndc	'n/*/(status dumpdb reload stats trace notrace \
61669408Sache			querylog start stop restart )/'
617145479Smp    if ($?traditional_complete) then
618145479Smp        complete nm \
619145479Smp		'c/--/(debug-syms defined-only demangle dynamic \
62069408Sache			extern-only format= help line-numbers no-demangle \
62169408Sache			no-sort numeric-sort portability print-armap \
62269408Sache			print-file-name reverse-sort size-sort undefined-only \
62369408Sache			version)/' 'p/*/f:^*.{h,C,c,cc}/'
624145479Smp    else
625145479Smp	complete nm \
626145479Smp		'c/--radix=/x:<radix: _o_ctal _d_ecimal he_x_adecimal>/' \
627131962Smp		'c/--target=/x:<bfdname>/' \
628131962Smp		'c/--format=/(bsd sysv posix)/n/' \
629131962Smp		'c/--/(debugsyms extern-only demangle dynamic print-armap \
630131962Smp			print-file-name numeric-sort no-sort reverse-sort \
631131962Smp			size-sort undefined-only portability target= radix= \
632131962Smp			format= defined-only\ line-numbers no-demangle version \
633131962Smp			help)//' \
634131962Smp		'n/*/f:^*.{h,c,cc,s,S}/'
635145479Smp    endif
63669408Sache    complete nmap	'n@-e@`ifconfig -l`@' 'p/*/$hostnames/'
63769408Sache    complete perldoc 	'n@*@`\ls -1 /usr/libdata/perl/5.*/pod | sed s%\\.pod.\*\$%%`@'
63869408Sache    complete postfix    'n/*/(start stop reload abort flush check)/'
639232633Smp    complete postmap	'n/1/(hash: regexp:)/' 'c/hash:/f/' 'c/regexp:/f/'
64069408Sache    complete rcsdiff	'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
64169408Sache    complete X		'c/-/(I a ac allowMouseOpenFail allowNonLocalModInDev \
64269408Sache			allowNonLocalXvidtune ar1 ar2 audit auth bestRefresh \
64369408Sache			bgamma bpp broadcast bs c cc class co core deferglyphs \
64469408Sache			disableModInDev disableVidMode displayID dpi dpms f fc \
64569408Sache			flipPixels fn fp gamma ggamma help indirect kb keeptty \
64669408Sache			ld lf logo ls nolisten string noloadxkb nolock nopn \
64769408Sache			once p pn port probeonly query quiet r rgamma s \
64869408Sache			showconfig sp su t terminate to tst v verbose version \
64969408Sache			weight wm x xkbdb xkbmap)/'
65069408Sache    complete users      'c/--/(help version)/' 'p/1/x:"<accounting_file>"/'
65169408Sache    complete vidcontrol	'p/1/(132x25 132x30 132x43 132x50 132x60 40x25 80x25 \
65269408Sache			80x30 80x43 80x50 80x60 EGA_80x25 EGA_80x43 \
65369408Sache			VESA_132x25 VESA_132x30 VESA_132x43 VESA_132x50 \
65469408Sache			VESA_132x60 VESA_800x600 VGA_320x200 VGA_40x25 \
65569408Sache			VGA_80x25 VGA_80x30 VGA_80x50 VGA_80x60)/'
65669408Sache    complete vim	'n/*/f:^*.[oa]/'
65769408Sache    complete where	'n/*/c/'
65869408Sache    complete which	'n/*/c/'
65969408Sache    complete wmsetbg	'c/-/(display D S a b c d e m p s t u w)/' \
66069408Sache			'c/--/(back-color center colors dither help match \
66169408Sache			maxscale parse scale smooth tile update-domain \
66269408Sache			update-wmaker version workspace)/'
66369408Sache    complete xdb	'p/1/c/'
66469408Sache    complete xdvi	'c/-/(allowshell debug display expert gamma hushchars \
66569408Sache			hushchecksums hushspecials install interpreter keep \
66669408Sache			margins nogrey noinstall nomakepk noscan paper safer \
66769408Sache			shrinkbuttonn thorough topmargin underlink version)/' \
66869408Sache			'n/-paper/(a4 a4r a5 a5r)/' 'p/*/f:*.dvi/'
66969408Sache    complete xlock	'c/-/(allowaccess allowroot debug description \
67069408Sache			echokeys enablesaver grabmouse grabserver hide inroot \
67169408Sache			install inwindow mono mousemotion nolock remote \
67269408Sache			resetsaver sound timeelapsed use3d usefirst verbose \
67369408Sache			wireframe background batchcount bg bitmap both3d \
67469408Sache			count cycles delay delta3d display dpmsoff \
67569408Sache			dpmsstandby dpmssuspend endCmd erasedelay erasemode \
67669408Sache			erasetime fg font foreground geometry help \
67769408Sache			icongeometry info invalid left3d lockdelay logoutCmd \
67869408Sache			mailCmd mailIcon message messagefile messagefont \
67969408Sache			messagesfile mode name ncolors nice nomailIcon none3d \
68069408Sache			parent password planfont program resources right3d \
68169408Sache			saturation size startCmd timeout username validate \
68269408Sache			version visual)/' 'n/-mode/(ant atlantis ball bat \
68369408Sache			blot bouboule bounce braid bubble bubble3d bug cage \
68469408Sache			cartoon clock coral crystal daisy dclock decay deco \
68569408Sache			demon dilemma discrete drift eyes fadeplot flag flame \
68669408Sache			flow forest galaxy gears goop grav helix hop hyper \
68769408Sache			ico ifs image invert julia kaleid kumppa lament laser \
68869408Sache			life life1d life3d lightning lisa lissie loop lyapunov \
68969408Sache			mandelbrot marquee matrix maze moebius morph3d \
69069408Sache			mountain munch nose pacman penrose petal pipes puzzle \
69169408Sache			pyro qix roll rotor rubik shape sierpinski slip sphere \
69269408Sache			spiral spline sproingies stairs star starfish strange \
69369408Sache			superquadrics swarm swirl tetris thornbird triangle \
69469408Sache			tube turtle vines voters wator wire world worm xjack \
69569408Sache			blank bomb random)/' 
69669408Sache    complete xfig	'c/-/(display)/' 'p/*/f:*.fig/'
69769408Sache    complete wget 	c/--/"(accept= append-output= background cache= \
69869408Sache			continue convert-links cut-dirs= debug \
69969408Sache			delete-after directory-prefix= domains= \
70069408Sache			dont-remove-listing dot-style= exclude-directories= \
70169408Sache			exclude-domains= execute= follow-ftp \
70269408Sache			force-directories force-html glob= header= help \
70369408Sache			http-passwd= http-user= ignore-length \
70469408Sache			include-directories= input-file= level= mirror \
70569408Sache			no-clobber no-directories no-host-directories \
70669408Sache			no-host-lookup no-parent non-verbose \
70769408Sache			output-document= output-file= passive-ftp \
70869408Sache			proxy-passwd= proxy-user= proxy= quiet quota= \
70969408Sache			recursive reject= relative retr-symlinks save-headers \
71069408Sache			server-response span-hosts spider timeout= \
71169408Sache			timestamping tries= user-agent= verbose version wait=)"/
71269408Sache
71369408Sache    # these from Tom Warzeka <tom@waz.cc>
71459243Sobrien
71559243Sobrien    # this one works but is slow and doesn't descend into subdirectories
71659243Sobrien    # complete	cd	C@[./\$~]*@d@ \
71759243Sobrien    #			p@1@'`\ls -1F . $cdpath | grep /\$ | sort -u`'@ n@*@n@
71859243Sobrien
71959243Sobrien    if ( -r /etc/shells ) then
72059243Sobrien        complete setenv	p@1@e@ n@DISPLAY@\$hosts@: n@SHELL@'`cat /etc/shells`'@
72159243Sobrien    else
72259243Sobrien	complete setenv	p@1@e@ n@DISPLAY@\$hosts@:
72359243Sobrien    endif
72459243Sobrien    complete unsetenv	n/*/e/
72559243Sobrien
726131962Smp    set _maildir = /var/mail
727195609Smp    if (-r "$HOME/.mailrc") then
72859243Sobrien        complete mail	c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
729195609Smp			"c@+@F:$HOME/Mail@" C@[./\$~]@f@ n/-s/x:'<subject>'/ \
73059243Sobrien			n@-u@T:$_maildir@ n/-f/f/ \
731195609Smp			n@*@'`sed -n s/alias//p "$HOME/.mailrc" | \
732195609Smp			tr -s " " "	" | cut -f 2`'@
73359243Sobrien    else
73459243Sobrien        complete mail	c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
735195609Smp			"c@+@F:$HOME/Mail@" C@[./\$~]@f@ n/-s/x:'<subject>'/ \
73659243Sobrien			n@-u@T:$_maildir@ n/-f/f/ n/*/u/
73759243Sobrien    endif
73883098Smp    unset _maildir
73959243Sobrien
740100616Smp    if (! $?MANPATH) then
741100616Smp	if (-r /usr/share/man) then
742100616Smp	    setenv MANPATH /usr/share/man:
743100616Smp	else
744100616Smp	    setenv MANPATH /usr/man:
745100616Smp	endif
74683098Smp    endif
747100616Smp
748145479Smp    if ($?traditional_complete) then
749145479Smp        # use of $MANPATH from Dan Nicolaescu <dann@ics.uci.edu>
750145479Smp        # use of 'find' adapted from Lubomir Host <host8@kepler.fmph.uniba.sk>
751145479Smp        complete man \
752100616Smp	    'n@1@`set q = "$MANPATH:as%:%/man1 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.1.\*\$%%`@'\
753100616Smp	    'n@2@`set q = "$MANPATH:as%:%/man2 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.2.\*\$%%`@'\
754100616Smp	    'n@3@`set q = "$MANPATH:as%:%/man3 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.3.\*\$%%`@'\
755100616Smp	    'n@4@`set q = "$MANPATH:as%:%/man4 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.4.\*\$%%`@'\
756100616Smp	    'n@5@`set q = "$MANPATH:as%:%/man5 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.5.\*\$%%`@'\
757100616Smp	    'n@6@`set q = "$MANPATH:as%:%/man6 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.6.\*\$%%`@'\
758100616Smp	    'n@7@`set q = "$MANPATH:as%:%/man7 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.7.\*\$%%`@'\
759100616Smp	    'n@8@`set q = "$MANPATH:as%:%/man8 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.8.\*\$%%`@'\
760100616Smp	    'n@9@`set q = "$MANPATH:as%:%/man9 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.9.\*\$%%`@'\
761100616Smp	    'n@0@`set q = "$MANPATH:as%:%/man0 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.0.\*\$%%`@'\
762100616Smp	    'n@n@`set q = "$MANPATH:as%:%/mann %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.n.\*\$%%`@'\
763100616Smp	    'n@o@`set q = "$MANPATH:as%:%/mano %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.o.\*\$%%`@'\
764100616Smp	    'n@l@`set q = "$MANPATH:as%:%/manl %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.l.\*\$%%`@'\
765100616Smp	    'n@p@`set q = "$MANPATH:as%:%/manp %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.p.\*\$%%`@'\
766100616Smp	    c@-@"(- f k M P s S t)"@ n@-f@c@ n@-k@x:'<keyword>'@ n@-[MP]@d@   \
767100616Smp	    'N@-[MP]@`\ls -1 $:-1/man? |& sed -n s%\\..\\+\$%%p`@'            \
768100616Smp	    'n@-[sS]@`\ls -1 $MANPATH:as%:% % |& sed -n s%^man%%p | sort -u`@'\
769100616Smp	    'n@*@`find $MANPATH:as%:% % \( -type f -o -type l \) -printf "%f " |& sed -e "s%find: .*: No such file or directory%%" -e "s%\([^\.]\+\)\.\([^ ]*\) %\1 %g"`@'
770100616Smp	    #n@*@c@ # old way -- commands only
771145479Smp    else
772145479Smp        complete man	    n@1@'`\ls -1 /usr/man/man1 | sed s%\\.1.\*\$%%`'@ \
773131962Smp			    n@2@'`\ls -1 /usr/man/man2 | sed s%\\.2.\*\$%%`'@ \
774131962Smp			    n@3@'`\ls -1 /usr/man/man3 | sed s%\\.3.\*\$%%`'@ \
775131962Smp			    n@4@'`\ls -1 /usr/man/man4 | sed s%\\.4.\*\$%%`'@ \
776131962Smp			    n@5@'`\ls -1 /usr/man/man5 | sed s%\\.5.\*\$%%`'@ \
777131962Smp			    n@6@'`\ls -1 /usr/man/man6 | sed s%\\.6.\*\$%%`'@ \
778131962Smp			    n@7@'`\ls -1 /usr/man/man7 | sed s%\\.7.\*\$%%`'@ \
779131962Smp			    n@8@'`\ls -1 /usr/man/man8 | sed s%\\.8.\*\$%%`'@ \
780131962Smp    n@9@'`[ -r /usr/man/man9 ] && \ls -1 /usr/man/man9 | sed s%\\.9.\*\$%%`'@ \
781131962Smp    n@0@'`[ -r /usr/man/man0 ] && \ls -1 /usr/man/man0 | sed s%\\.0.\*\$%%`'@ \
782131962Smp  n@new@'`[ -r /usr/man/mann ] && \ls -1 /usr/man/mann | sed s%\\.n.\*\$%%`'@ \
783131962Smp  n@old@'`[ -r /usr/man/mano ] && \ls -1 /usr/man/mano | sed s%\\.o.\*\$%%`'@ \
784131962Smpn@local@'`[ -r /usr/man/manl ] && \ls -1 /usr/man/manl | sed s%\\.l.\*\$%%`'@ \
785131962Smpn@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
786131962Smp		c/-/"(- f k P s t)"/ n/-f/c/ n/-k/x:'<keyword>'/ n/-P/d/ \
787131962Smp		N@-P@'`\ls -1 $:-1/man? | sed s%\\..\*\$%%`'@ n/*/c/
788145479Smp    endif
78959243Sobrien
79059243Sobrien    complete ps	        c/-t/x:'<tty>'/ c/-/"(a c C e g k l S t u v w x)"/ \
79159243Sobrien			n/-k/x:'<kernel>'/ N/-k/x:'<core_file>'/ n/*/x:'<PID>'/
79259243Sobrien    complete compress	c/-/"(c f v b)"/ n/-b/x:'<max_bits>'/ n/*/f:^*.Z/
79359243Sobrien    complete uncompress	c/-/"(c f v)"/                        n/*/f:*.Z/
79459243Sobrien
79569408Sache    complete uuencode	p/1/f/ p/2/x:'<decode_pathname>'/ n/*/n/
79669408Sache    complete uudecode	c/-/"(f)"/ n/-f/f:*.{uu,UU}/ p/1/f:*.{uu,UU}/ n/*/n/
79769408Sache
79859243Sobrien    complete xhost	c/[+-]/\$hosts/ n/*/\$hosts/
799100616Smp    complete xpdf	c/-/"(z g remote raise quit cmap rgb papercolor       \
800100616Smp			      eucjp t1lib freetype ps paperw paperh level1    \
801100616Smp			      upw fullscreen cmd q v h help)"/                \
802100616Smp			n/-z/x:'<zoom (-5 .. +5) or "page" or "width">'/      \
803100616Smp			n/-g/x:'<geometry>'/ n/-remote/x:'<name>'/            \
804100616Smp			n/-rgb/x:'<number>'/ n/-papercolor/x:'<color>'/       \
805100616Smp			n/-{t1lib,freetype}/x:'<font_type>'/                  \
806100616Smp			n/-ps/x:'<PS_file>'/ n/-paperw/x:'<width>'/           \
807100616Smp			n/-paperh/x:'<height>'/ n/-upw/x:'<password>'/        \
808100616Smp			n/-/f:*.{pdf,PDF}/                                    \
809100616Smp			N/-{z,g,remote,rgb,papercolor,t1lib,freetype,ps,paperw,paperh,upw}/f:*.{pdf,PDF}/ \
810100616Smp			N/-/x:'<page>'/ p/1/f:*.{pdf,PDF}/ p/2/x:'<page>'/
81159243Sobrien
812131962Smp    complete tcsh	c/-D*=/'x:<value>'/ c/-D/'x:<name>'/ \
813131962Smp			c/-/"(b c d D e f F i l m n q s t v V x X -version)"/ \
814131962Smp			n/-c/c/ n/{-l,--version}/n/ n/*/'f:*.{,t}csh'/
815131962Smp
816131962Smp    complete rpm	c/--/"(query verify nodeps nofiles nomd5 noscripts    \
817131962Smp	                nogpg nopgp install upgrade freshen erase allmatches  \
818131962Smp		        notriggers repackage test rebuild recompile initdb    \
819131962Smp		        rebuilddb addsign resign querytags showrc setperms    \
820131962Smp		        setugids all file group package querybynumber qf      \
821131962Smp		        triggeredby whatprovides whatrequires changelog       \
822131962Smp		        configfiles docfiles dump filesbypkg info last list   \
823131962Smp		        provides queryformat requires scripts state triggers  \
824131962Smp		        triggerscripts allfiles badreloc excludepath checksig \
825131962Smp	                excludedocs force hash ignoresize ignorearch ignoreos \
826131962Smp		        includedocs justdb noorder oldpackage percent prefix  \
827131962Smp		        relocate replace-files replacepkgs buildroot clean    \
828131962Smp		        nobuild rmsource rmspec short-circuit sign target     \
829131962Smp		        help version quiet rcfile pipe dbpath root specfile)"/\
830131962Smp		        c/-/"(q V K i U F e ba bb bp bc bi bl bs ta tb tp tc  \
831131962Smp			ti tl ts a f g p c d l R s h ? v vv -)"/              \
832131962Smp		n/{-f,--file}/f/ n/{-g,--group}/g/ n/--pipe/c/ n/--dbpath/d/  \
833131962Smp		n/--querybynumber/x:'<number>'/ n/--triggeredby/x:'<package>'/\
834131962Smp		n/--what{provides,requires}/x:'<capability>'/ n/--root/d/     \
835131962Smp		n/--{qf,queryformat}/x:'<format>'/ n/--buildroot/d/           \
836131962Smp		n/--excludepath/x:'<oldpath>'/  n/--prefix/x:'<newpath>'/     \
837131962Smp		n/--relocate/x:'<oldpath=newpath>'/ n/--target/x:'<platform>'/\
838131962Smp		n/--rcfile/x:'<filelist>'/ n/--specfile/x:'<specfile>'/       \
839131962Smp	        n/{-[iUFep],--{install,upgrade,freshen,erase,package}}/f:*.rpm/
840131962Smp
84159243Sobrien    # these conform to the latest GNU versions available at press time ...
84259243Sobrien    # updates by John Gotts <jgotts@engin.umich.edu>
84383098Smp    if (-X emacs) then
84483098Smp      # TW note:  if your version of GNU Emacs supports the "--version" option,
84583098Smp      #           uncomment this line and comment the next to automatically
846131962Smp      #           detect the version, else set "_emacs_ver" to your version.
847100616Smp      #set _emacs_ver=`emacs --version | sed -e 's%GNU Emacs %%' -e q | cut -d . -f1-2`
848131962Smp      set _emacs_ver=21.3
84983098Smp      set _emacs_dir=`which emacs | sed s%/bin/emacs%%` 
85083098Smp      complete emacs	c/--/"(batch terminal display no-windows no-init-file \
85183098Smp                               user debug-init unibyte multibyte version help \
85283098Smp                               no-site-file funcall load eval insert kill)"/ \
85383098Smp                        c/-/"(t d nw q u f l -)"/ c/+/x:'<line_number>'/ \
85483098Smp			n/{-t,--terminal}/x:'<terminal>'/ n/{-d,--display}/x:'<display>'/ \
85583098Smp	                n/{-u,--user}/u/ n/{-f,--funcall}/x:'<lisp_function>'/ \
85683098Smp			n@{-l,--load}@F:$_emacs_dir/share/emacs/$_emacs_ver/lisp@ \
85783098Smp			n/--eval/x:'<expression>'/ n/--insert/f/ n/*/f:^*[\#~]/
85883098Smp      unset _emacs_ver _emacs_dir
85983098Smp    endif
86059243Sobrien
86159243Sobrien    complete gzcat	c/--/"(force help license quiet version)"/ \
86259243Sobrien			c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
86359243Sobrien    complete gzip	c/--/"(stdout to-stdout decompress uncompress \
86459243Sobrien			force help list license no-name quiet recurse \
86559243Sobrien			suffix test verbose version fast best)"/ \
86659243Sobrien			c/-/"(c d f h l L n q r S t v V 1 2 3 4 5 6 7 8 9 -)"/\
86759243Sobrien			n/{-S,--suffix}/x:'<file_name_suffix>'/ \
86859243Sobrien			n/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
86959243Sobrien			N/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
87059243Sobrien			n/*/f:^*.{gz,Z,z,zip,taz,tgz}/
87159243Sobrien    complete {gunzip,ungzip} c/--/"(stdout to-stdout force help list license \
87259243Sobrien			no-name quiet recurse suffix test verbose version)"/ \
87359243Sobrien			c/-/"(c f h l L n q r S t v V -)"/ \
87459243Sobrien			n/{-S,--suffix}/x:'<file_name_suffix>'/ \
87559243Sobrien			n/*/f:*.{gz,Z,z,zip,taz,tgz}/
87659243Sobrien    complete zgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
87759243Sobrien			c/-/"(A b B c C e f h i l n s v V w x)"/ \
87859243Sobrien			p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
87959243Sobrien			n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
88059243Sobrien    complete zegrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
88159243Sobrien			c/-/"(A b B c C e f h i l n s v V w x)"/ \
88259243Sobrien			p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
88359243Sobrien			n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
88459243Sobrien    complete zfgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
88559243Sobrien			c/-/"(A b B c C e f h i l n s v V w x)"/ \
88659243Sobrien			p/1/x:'<fixed_string>'/ N/-*e/f/ \
88759243Sobrien			n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
88859243Sobrien    complete znew	c/-/"(f t v 9 P K)"/ n/*/f:*.Z/
88959243Sobrien    complete zmore	n/*/f:*.{gz,Z,z,zip}/
89059243Sobrien    complete zfile	n/*/f:*.{gz,Z,z,zip,taz,tgz}/
89159243Sobrien    complete ztouch	n/*/f:*.{gz,Z,z,zip,taz,tgz}/
89259243Sobrien    complete zforce	n/*/f:^*.{gz,tgz}/
89359243Sobrien
894131962Smp    complete dcop 'p/1/`$:0`/ /' \
895131962Smp	'p/2/`$:0 $:1 | awk \{print\ \$1\}`/ /' \
896131962Smp	'p/3/`$:0 $:1 $:2 | sed "s%.* \(.*\)(.*%\1%"`/ /'
897131962Smp
898131962Smp
89959243Sobrien    complete grep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
90059243Sobrien			c/--/"(extended-regexp fixed-regexp basic-regexp \
90159243Sobrien			regexp file ignore-case word-regexp line-regexp \
90259243Sobrien			no-messages revert-match version help byte-offset \
90359243Sobrien			line-number with-filename no-filename quiet silent \
90459243Sobrien			text directories recursive files-without-match \
90559243Sobrien			files-with-matches count before-context after-context \
90659243Sobrien			context binary unix-byte-offsets)"/ \
90759243Sobrien			c/-/"(A a B b C c d E e F f G H h i L l n q r s U u V \
90859243Sobrien				v w x)"/ \
90959243Sobrien			p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
91059243Sobrien			n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
91159243Sobrien    complete egrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
91259243Sobrien			c/--/"(extended-regexp fixed-regexp basic-regexp \
91359243Sobrien			regexp file ignore-case word-regexp line-regexp \
91459243Sobrien			no-messages revert-match version help byte-offset \
91559243Sobrien			line-number with-filename no-filename quiet silent \
91659243Sobrien			text directories recursive files-without-match \
91759243Sobrien			files-with-matches count before-context after-context \
91859243Sobrien			context binary unix-byte-offsets)"/ \
91959243Sobrien			c/-/"(A a B b C c d E e F f G H h i L l n q r s U u V \
92059243Sobrien				v w x)"/ \
92159243Sobrien			p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
92259243Sobrien			n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
92359243Sobrien    complete fgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
92459243Sobrien			c/--/"(extended-regexp fixed-regexp basic-regexp \
92559243Sobrien			regexp file ignore-case word-regexp line-regexp \
92659243Sobrien			no-messages revert-match version help byte-offset \
92759243Sobrien			line-number with-filename no-filename quiet silent \
92859243Sobrien			text directories recursive files-without-match \
92959243Sobrien			files-with-matches count before-context after-context \
93059243Sobrien			context binary unix-byte-offsets)"/ \
93159243Sobrien			c/-/"(A a B b C c d E e F f G H h i L l n q r s U u V \
93259243Sobrien				v w x)"/ \
93359243Sobrien			p/1/x:'<fixed_string>'/ N/-*e/f/ \
93459243Sobrien			n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
93559243Sobrien
936100616Smp    complete sed	c/--/"(quiet silent version help expression file)"/   \
937100616Smp			c/-/"(n V e f -)"/ n/{-e,--expression}/x:'<script>'/  \
938100616Smp			n/{-f,--file}/f:*.sed/ N/-{e,f,-{file,expression}}/f/ \
939100616Smp			n/-/x:'<script>'/ N/-/f/ p/1/x:'<script>'/ p/2/f/
940100616Smp
94159243Sobrien    complete users	c/--/"(help version)"/ p/1/x:'<accounting_file>'/
94259243Sobrien    complete who	c/--/"(heading idle count mesg message writable help \
94359243Sobrien    			version)"/ c/-/"(H i m q s T w u -)"/ \
94459243Sobrien			p/1/x:'<accounting_file>'/ n/am/"(i)"/ n/are/"(you)"/
94559243Sobrien
94659243Sobrien    complete chown	c/--/"(changes dereference no-dereference silent \
94759243Sobrien    			quiet reference recursive verbose help version)"/ \
94859243Sobrien			c/-/"(c f h R v -)"/ C@[./\$~]@f@ c/*[.:]/g/ \
94969408Sache			n/-/u/: p/1/u/: n/*/f/
95059243Sobrien    complete chgrp	c/--/"(changes no-dereference silent quiet reference \
95159243Sobrien    			recursive verbose help version)"/ \
95259243Sobrien			c/-/"(c f h R v -)"/ n/-/g/ p/1/g/ n/*/f/
95359243Sobrien    complete chmod	c/--/"(changes silent quiet verbose reference \
95459243Sobrien    			recursive help version)"/ c/-/"(c f R v)"/
95559243Sobrien    complete df		c/--/"(all block-size human-readable si inodes \
95659243Sobrien			kilobytes local megabytes no-sync portability sync \
95759243Sobrien			type print-type exclude-type help version)"/ \
95859243Sobrien			c/-/"(a H h i k l m P T t v x)"/
95959243Sobrien    complete du		c/--/"(all block-size bytes total dereference-args \
96059243Sobrien    			human-readable si kilobytes count-links dereference \
96159243Sobrien			megabytes separate-dirs summarize one-file-system \
96259243Sobrien			exclude-from exclude max-depth help version"/ \
96359243Sobrien			c/-/"(a b c D H h k L l m S s X x)"/
96459243Sobrien
96559243Sobrien    complete cat	c/--/"(number-nonblank number squeeze-blank show-all \
96659243Sobrien			show-nonprinting show-ends show-tabs help version)"/ \
96759243Sobrien			c/-/"(A b E e n s T t u v -)"/ n/*/f/
96859243Sobrien    complete mv		c/--/"(backup force interactive update verbose suffix \
96959243Sobrien			version-control help version)"/ \
97059243Sobrien			c/-/"(b f i S u V v -)"/ \
97159243Sobrien			n/{-S,--suffix}/x:'<suffix>'/ \
97259243Sobrien			n/{-V,--version-control}/"(t numbered nil existing \
97359243Sobrien			never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
97459243Sobrien    complete cp		c/--/"(archive backup no-dereference force \
97559243Sobrien    			interactive link preserve parents sparse recursive \
97659243Sobrien			symbolic-link suffix update verbose version-control \
97759243Sobrien			one-file-system help version)"/ \
97859243Sobrien			c/-/"(a b d f i l P p R r S s u V v x -)"/ \
97959243Sobrien			n/-*r/d/ n/{-S,--suffix}/x:'<suffix>'/ \
98059243Sobrien			n/{-V,--version-control}/"(t numbered nil existing \
98159243Sobrien			never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
98259243Sobrien    complete ln		c/--/"(backup directory force no-dereference \
98359243Sobrien    			interactive symbolic suffix verbose version-control \
98459243Sobrien			help version)"/ \
98559243Sobrien			c/-/"(b d F f i n S s V v -)"/ \
98659243Sobrien			n/{-S,--suffix}/x:'<suffix>'/ \
98759243Sobrien			n/{-V,--version-control}/"(t numbered nil existing \
98859243Sobrien			never simple)"/ n/-/f/ N/-/x:'<link_name>'/ \
98959243Sobrien			p/1/f/ p/2/x:'<link_name>'/
99059243Sobrien    complete touch	c/--/"(date reference time help version)"/ \
99159243Sobrien			c/-/"(a c d f m r t -)"/ \
99259243Sobrien			n/{-d,--date}/x:'<date_string>'/ \
99359243Sobrien			c/--time/"(access atime mtime modify use)"/ \
99459243Sobrien			n/{-r,--file}/f/ n/-t/x:'<time_stamp>'/ n/*/f/
99559243Sobrien    complete mkdir	c/--/"(mode parents verbose help version)"/ \
99659243Sobrien    			c/-/"(p m -)"/ \
99759243Sobrien			n/{-m,--mode}/x:'<mode>'/ n/*/d/
99859243Sobrien    complete rmdir	c/--/"(ignore-fail-on-non-empty parents verbose help \
99959243Sobrien    			version)"/ c/-/"(p -)"/ n/*/d/
1000131962Smp    complete env 	'c/*=/f/' 'p/1/e/=/' 'p/2/c/'
100159243Sobrien
100259243Sobrien    complete tar	c/-[Acru]*/"(b B C f F g G h i l L M N o P \
100359243Sobrien			R S T v V w W X z Z)"/ \
100459243Sobrien			c/-[dtx]*/"( B C f F g G i k K m M O p P \
100559243Sobrien			R s S T v w x X z Z)"/ \
100659243Sobrien			p/1/"(A c d r t u x -A -c -d -r -t -u -x \
100759243Sobrien			--catenate --concatenate --create --diff --compare \
100859243Sobrien			--delete --append --list --update --extract --get \
100959243Sobrien			--help --version)"/ \
101059243Sobrien			c/--/"(catenate concatenate create diff compare \
101159243Sobrien			delete append list update extract get atime-preserve \
101259243Sobrien			block-size read-full-blocks directory checkpoint file \
101359243Sobrien			force-local info-script new-volume-script incremental \
101459243Sobrien			listed-incremental dereference ignore-zeros \
101559243Sobrien			ignore-failed-read keep-old-files starting-file \
101659243Sobrien			one-file-system tape-length modification-time \
101759243Sobrien			multi-volume after-date newer old-archive portability \
101859243Sobrien			to-stdout same-permissions preserve-permissions \
101959243Sobrien			absolute-paths preserve record-number remove-files \
102059243Sobrien			same-order preserve-order same-owner sparse \
102159243Sobrien			files-from null totals verbose label version \
102259243Sobrien			interactive confirmation verify exclude exclude-from \
102359243Sobrien			compress uncompress gzip ungzip use-compress-program \
102459243Sobrien			block-compress help version)"/ \
102559243Sobrien			c/-/"(b B C f F g G h i k K l L m M N o O p P R s S \
102659243Sobrien			T v V w W X z Z 0 1 2 3 4 5 6 7 -)"/ \
1027131962Smp			C@/dev@f@ \
102859243Sobrien			n/-c*f/x:'<new_tar_file, device_file, or "-">'/ \
1029145479Smp			n/{-[Adrtux]j*f,--file}/f:*.{tar.bz2,tbz}/ \
1030131962Smp			n/{-[Adrtux]z*f,--file}/f:*.{tar.gz,tgz}/ \
1031131962Smp			n/{-[Adrtux]Z*f,--file}/f:*.{tar.Z,taz}/ \
1032131962Smp			n/{-[Adrtux]*f,--file}/f:*.tar/ \
1033145479Smp			N/{-xj*f,--file}/'`tar -tjf $:-1`'/ \
1034131962Smp			N/{-xz*f,--file}/'`tar -tzf $:-1`'/ \
1035131962Smp			N/{-xZ*f,--file}/'`tar -tZf $:-1`'/ \
103659243Sobrien			N/{-x*f,--file}/'`tar -tf $:-1`'/ \
103759243Sobrien			n/--use-compress-program/c/ \
103859243Sobrien			n/{-b,--block-size}/x:'<block_size>'/ \
103959243Sobrien			n/{-V,--label}/x:'<volume_label>'/ \
104059243Sobrien			n/{-N,--{after-date,newer}}/x:'<date>'/ \
104159243Sobrien			n/{-L,--tape-length}/x:'<tape_length_in_kB>'/ \
104259243Sobrien			n/{-C,--directory}/d/ \
104359243Sobrien			N/{-C,--directory}/'`\ls $:-1`'/ \
104459243Sobrien			n/-[0-7]/"(l m h)"/
104559243Sobrien
1046195609Smp    switch ( "$OSTYPE" )
1047195609Smp    case "linux":
1048195609Smp      # Linux filesystems
1049195609Smp      complete  mount	c/-/"(a f F h l n o r s t U v V w)"/ n/-[hV]/n/ \
1050195609Smp			n/-o/x:'<options>'/ n/-t/x:'<vfstype>'/ \
1051195609Smp			n/-L/x:'<label>'/ n/-U/x:'<uuid>'/ \
1052195609Smp			n@*@'`grep -v "^#" /etc/fstab | tr -s " " "	 " | cut -f 2`'@
1053195609Smp      complete umount	c/-/"(a h n r t v V)"/ n/-t/x:'<vfstype>'/ \
1054195609Smp			  n/*/'`mount | cut -d " " -f 3`'/
1055195609Smp      breaksw
1056195609Smp    case "sunos*":
1057195609Smp    case "solaris":
1058195609Smp      # Solaris filesystems
1059195609Smp      complete  mount	c/-/"(a F m o O p r v V)"/ n/-p/n/ n/-v/n/ \
1060195609Smp      			n/-o/x:'<FSType_options>'/ \
1061195609Smp      			n@-F@'`\ls -1 /usr/lib/fs`'@ \
1062195609Smp      			n@*@'`grep -v "^#" /etc/vfstab | tr -s " " "	 " | cut -f 3`'@
1063195609Smp      complete umount	c/-/"(a o V)"/ n/-o/x:'<FSType_options>'/ \
1064195609Smp      			n/*/'`mount | cut -d " " -f 1`'/
1065195609Smp      complete  mountall	c/-/"(F l r)"/ n@-F@'`\ls -1 /usr/lib/fs`'@
1066195609Smp      complete umountall	c/-/"(F h k l r s)"/ n@-F@'`\ls -1 /usr/lib/fs`'@ \
1067195609Smp      			n/-h/'`df -k | cut -s -d ":" -f 1 | sort -u`'/
1068195609Smp      breaksw
1069195609Smp    case "cygwin":
1070195609Smp      # Cygwin mounts
1071195609Smp      complete  mount	c/-/"(b c f h m o p s t u v x E X)"/ n/-[hmpv]/n/ \
1072195609Smp      			n/-c/x:'/'/ \
1073195609Smp			n/-o/"(user system binary text exec notexec cygexec nosuid managed)"/ \
1074195609Smp      			n@*@'`mount -p | tail -1 | cut -d " " -f 1 | xargs ls -1 | awk '"'"'{print $1":/"; } END{print "//";}'"'"'`'@
1075195609Smp      complete umount	c/-/"(A c h s S u U v)"/ n/-[AhSUv]/n/ \
1076195609Smp      			n@*@'`mount | grep -v noumount | cut -d " " -f 3`'@
1077195609Smp      breaksw
1078195609Smp    default:
1079195609Smp      breaksw
1080195609Smp    endsw
108159243Sobrien
108259243Sobrien    # these deal with NIS (formerly YP); if it's not running you don't need 'em
108383098Smp    if (-X domainname) then
108483098Smp      set _domain = "`domainname`"
108583098Smp      set _ypdir  = /var/yp	# directory where NIS (YP) maps are kept
108683098Smp      if ("$_domain" != "" && "$_domain" != "noname") then
108783098Smp        complete domainname p@1@D:$_ypdir@" " n@*@n@
108883098Smp        complete ypcat	    c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
108983098Smp	                    N@-d@\`\\ls\ -1\ $_ypdir/\$:-1\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
109083098Smp	                    n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
109183098Smp        complete ypmatch    c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
109283098Smp	                    N@-d@x:'<key ...>'@ n@-@x:'<key ...>'@ p@1@x:'<key ...>'@ \
109383098Smp	                    n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
109483098Smp        complete ypwhich    c@-@"(d m t x V1 V2)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
109583098Smp	                    n@-m@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
109683098Smp			    N@-m@n@ n@*@\$hosts@
109783098Smp      endif
109883098Smp      unset _domain _ypdir
109983098Smp    endif
110059243Sobrien
110159243Sobrien    complete make \
110259243Sobrien	'n/-f/f/' \
110359243Sobrien      	'c/*=/f/' \
110459243Sobrien	'n@*@`cat -s GNUmakefile Makefile makefile |& sed -n -e "/No such file/d" -e "/^[^     #].*:/s/:.*//p"`@'
110559243Sobrien
110659243Sobrien    if ( -f /etc/printcap ) then
110759243Sobrien	set printers=(`sed -n -e "/^[^     #].*:/s/:.*//p" /etc/printcap`)
110859243Sobrien
110959243Sobrien	complete lpr    'c/-P/$printers/'
111059243Sobrien	complete lpq    'c/-P/$printers/'
111159243Sobrien	complete lprm   'c/-P/$printers/'
111259243Sobrien	complete lpquota        'p/1/(-Qprlogger)/' 'c/-P/$printers/'
111359243Sobrien	complete dvips  'c/-P/$printers/' 'n/-o/f:*.{ps,PS}/' 'n/*/f:*.dvi/'
111469408Sache	complete dvilj	'p/*/f:*.dvi/'
111559243Sobrien    endif
111659243Sobrien
1117131962Smp    # From Alphonse Bendt
1118131962Smp    complete ant \
1119131962Smp	 'n/-f/f:*.xml/' \
1120131962Smp	      'n@*@`cat build.xml | sed -n -e "s/[ \t]*<target[\t\n]*name=.\([a-zA-Z0-9_:]*\).*/\1/p"`@'
1121131962Smp
1122131962Smp    if ($?P4CLIENT && -X perl) then
1123131962Smp	# This is from Greg Allen.
1124131962Smp	set p4cmds=(add branch branches commands change changes client clients \
1125131962Smp	    counter counters delete depot depots describe diff diff2 \
1126131962Smp	    edit filelog files fix fixes fstat group groups have help \
1127131962Smp	    info integrate integrated job jobs jobspec label labels \
1128131962Smp	    labelsync lock obliterate opened passwd print protect rename \
1129131962Smp	    reopen resolve resolved revert review reviews set submit \
1130131962Smp	    sync triggers unlock user users verify where)
1131131962Smp	complete p4 'p/1/$p4cmds/' 'n/help/$p4cmds/' \
1132131962Smp	    'n%{-l,label}%`p4 labels | sed "s/Label \([^ ]*\) .*/\1/"`%' \
1133131962Smp	    'n%-t%`p4 $:1s | sed "s/[^ ]* \([^ ]*\) .*/\1/"`%' \
1134131962Smp	    'c%*@%`p4 labels | sed "s/Label \([^ ]*\) .*/\1/"`%' \
1135131962Smp	    'c@//*/*@`p4 files $:-0... |& perl -nle "m%\Q$:-0\E([^#][^/# ] \
1136131962Smp	    *)%;print "\$"1 if \\\!/no such/&&\!"\$"h{"\$"1}++"`@@' \
1137131962Smp	    'c@//@`p4 depots | sed "s/Depot \([^ ]*\) .*/\1/"`@/@'
1138131962Smp    endif
1139131962Smp
1140131962Smp
1141145479Smp    if (! $?traditional_complete) then
1142145479Smp        uncomplete vi
1143145479Smp        uncomplete vim
1144145479Smp        complete {vi,vim,gvim,nvi,elvis} 	n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/
1145145479Smp        complete {ispell,spell,spellword}	'n@-d@`ls /usr/lib/ispell/*.aff | sed -e "s/\.aff//" `@' 'n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/'
1146145479Smp        complete elm	'n/-[Ai]/f/' 'c@=@F:$HOME/Mail/@' 'n/-s/x:\<subject\>/'
1147145479Smp        complete ncftp	'n@*@`sed -e '1,2d' $HOME/.ncftp/bookmarks | cut -f 1,2 -d "," | tr "," "\012" | sort | uniq ` '@
1148145479Smp        complete bibtex	'n@*@`ls *.aux | sed -e "s/\.aux//"`'@
1149145479Smp        complete dvi2tty	n/*/f:*.dvi/	# Only files that match *.dvi
1150131962Smp	uncomplete gv
1151131962Smp	uncomplete ghostview
1152145479Smp        complete {gv,ghostview}	'n/*/f:*.{ps,eps,epsi}/'
1153145479Smp        complete enscript \
1154131962Smp		'c/--/(columns= pages= header= no-header truncate-lines \
1155131962Smp			line-numbers setpagedevice= escapes font= \
1156131962Smp			header-font= fancy-header no-job-header \
1157131962Smp			highlight-bars indent= filter= borders page-prefeed \
1158131962Smp			no-page-prefeed lineprinter lines-per-page= mail \
1159131962Smp			media= copies= newline= output= missing-characters \
1160131962Smp			printer= quiet silent landscape portrait \
1161131962Smp			baselineskip= statusdict= title= tabsize= underlay= \
1162131962Smp			verbose version encoding pass-through download-font= \
1163131962Smp			filter-stdin= help highlight-bar-gray= list-media \
1164131962Smp			list-options non-printable-format= page-label-format= \
1165131962Smp			printer-options= ul-angle= ul-font= ul-gray= \
1166131962Smp			ul-position= ul-style= \
1167131962Smp		     )/'
1168145479Smp    endif
1169131962Smp
1170145479Smp    complete dpkg \
1171145479Smp		'c/--{admindir,instdir,root}=/d/' \
1172131962Smp		'c/--debug=/n/' \
1173131962Smp		'c/--{admindir,debug,instdir,root}/(=)//' \
1174131962Smp		'c/--/(admindir= debug= instdir= root= \
1175131962Smp			assert-support-predepends assert-working-epoch \
1176131962Smp			audit auto-deconfigure clear-avail \
1177131962Smp			compare-versions configure contents control \
1178131962Smp			extract force-bad-path field \
1179131962Smp			force-configure-any force-conflicts \
1180131962Smp			force-depends force-depends-version force-help \
1181131962Smp			force-hold force-non-root \
1182131962Smp			force-overwrite-diverted \
1183131962Smp			force-remove-essential force-remove-reinstreq \
1184131962Smp			forget-old-unavail fsys-tarfile get-selections \
1185131962Smp			help ignore-depends info install largemem \
1186131962Smp			license list listfiles merge-avail no-act \
1187131962Smp			pending predep-package print-architecture \
1188131962Smp			print-gnu-build-architecture \
1189131962Smp			print-installation-architecture print-avail \
1190131962Smp			purge record-avail recursive refuse-downgrade \
1191131962Smp			remove search set-selections selected-only \
1192131962Smp			skip-same-version smallmem status unpack \
1193131962Smp			update-avail version vextract \
1194131962Smp		      )//' \
1195131962Smp		'n/{-l}/`dpkg -l|awk \{print\ \$2\}`/' \
1196131962Smp		'n/*/f:*.deb'/
1197145479Smp    complete dpkg-deb 	   'c/--{build}=/d/' \
1198131962Smp			   'c/--/(build contents info field control extract \
1199131962Smp				 vextract fsys-tarfile help version \
1200131962Smp				 license)//' \
1201131962Smp			   'n/*/f:*.deb/'
1202145479Smp    complete apt-get \
1203145479Smp	        'c/--/(build config-file diff-only download-only \
1204131962Smp		   fix-broken fix-missing force-yes help ignore-hold no-download \
1205131962Smp		   no-upgrade option print-uris purge reinstall quiet simulate \
1206131962Smp		   show-upgraded target-release tar-only version yes )/' \
1207131962Smp	    	'c/-/(b c= d f h m o= q qq s t x y )/' \
1208131962Smp 		'n/{source,build-dep}/x:<pkgname>/' \
1209131962Smp 		'n/{remove}/`dpkg -l|grep ^ii|awk \{print\ \$2\}`/' \
1210131962Smp 		'n/{install}/`apt-cache pkgnames | sort`/' \
1211131962Smp 		'C/*/(update upgrade dselect-upgrade source \
1212131962Smp		   build-dep check clean autoclean install remove)/'
1213145479Smp    complete apt-cache \
1214131962Smp 		'c/--/(all-versions config-file generate full help important \
1215131962Smp 		names-only option pkg-cache quiet recurse src-cache version )/' \
1216131962Smp 	    	'c/-/(c= h i o= p= q s= v)/' \
1217131962Smp  		'n/{search}/x:<regex>/' \
1218131962Smp 		'n/{pkgnames,policy,show,showpkg,depends,dotty}/`apt-cache pkgnames | sort`/' \
1219131962Smp 		'C/*/(add gencaches showpkg stats dump dumpavail unmet show \
1220131962Smp 		search depends pkgnames dotty policy )/'
1221131962Smp
122259243Sobrien    unset noglob
122383098Smp    unset _complete
1224131962Smp    unset traditional_complete
122559243Sobrienendif
122659243Sobrien
122759243Sobrienend:
122859243Sobrien	onintr
1229