complete.tcsh revision 59243
159243Sobrien#
259243Sobrien# $Id: complete.tcsh,v 1.32 1999/06/09 19:09:12 christos Exp $
359243Sobrien# example file using the new completion code
459243Sobrien#
559243Sobrien
659243Sobrienonintr -
759243Sobrienif (! $?prompt) goto end
859243Sobrien
959243Sobrienif ($?tcsh) then
1059243Sobrien    if ($tcsh != 1) then
1159243Sobrien   	set rev=$tcsh:r
1259243Sobrien	set rel=$rev:e
1359243Sobrien	set pat=$tcsh:e
1459243Sobrien	set rev=$rev:r
1559243Sobrien    endif
1659243Sobrien    if ($rev > 5 && $rel > 1) then
1759243Sobrien	set complete=1
1859243Sobrien    endif
1959243Sobrien    unset rev rel pat
2059243Sobrienendif
2159243Sobrien
2259243Sobrienif ($?complete) then
2359243Sobrien    set noglob
2459243Sobrien    set hosts
2559243Sobrien    foreach f ($HOME/.hosts /usr/local/etc/csh.hosts $HOME/.rhosts /etc/hosts.equiv)
2659243Sobrien        if ( -r $f ) then
2759243Sobrien	    set hosts = ($hosts `grep -v "+" $f | tr -s " " "	" | cut -f 1`)
2859243Sobrien	endif
2959243Sobrien    end
3059243Sobrien    if ( -r $HOME/.netrc ) then
3159243Sobrien	set f=`awk '/machine/ { print $2 }' < $HOME/.netrc` >& /dev/null
3259243Sobrien	set hosts=($hosts $f)
3359243Sobrien    endif
3459243Sobrien    unset f
3559243Sobrien    if ( ! $?hosts ) then
3659243Sobrien	set hosts=(hyperion.ee.cornell.edu phaeton.ee.cornell.edu \
3759243Sobrien		   guillemin.ee.cornell.edu vangogh.cs.berkeley.edu \
3859243Sobrien		   ftp.uu.net prep.ai.mit.edu export.lcs.mit.edu \
3959243Sobrien		   labrea.stanford.edu sumex-aim.stanford.edu \
4059243Sobrien		   tut.cis.ohio-state.edu)
4159243Sobrien    endif
4259243Sobrien
4359243Sobrien    complete ywho  	n/*/\$hosts/	# argument from list in $hosts
4459243Sobrien    complete rsh	p/1/\$hosts/ c/-/"(l n)"/   n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
4559243Sobrien    complete ssh	p/1/\$hosts/ c/-/"(l n)"/   n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
4659243Sobrien    complete xrsh	p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
4759243Sobrien    complete rlogin 	p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/
4859243Sobrien    complete telnet 	p/1/\$hosts/ p/2/x:'<port>'/ n/*/n/
4959243Sobrien
5059243Sobrien    complete cd  	p/1/d/		# Directories only
5159243Sobrien    complete chdir 	p/1/d/
5259243Sobrien    complete pushd 	p/1/d/
5359243Sobrien    complete popd 	p/1/d/
5459243Sobrien    complete pu 	p/1/d/
5559243Sobrien    complete po 	p/1/d/
5659243Sobrien    complete complete 	p/1/X/		# Completions only
5759243Sobrien    complete uncomplete	n/*/X/
5859243Sobrien    complete exec 	p/1/c/		# Commands only
5959243Sobrien    complete trace 	p/1/c/
6059243Sobrien    complete strace 	p/1/c/
6159243Sobrien    complete which	n/*/c/
6259243Sobrien    complete where	n/*/c/
6359243Sobrien    complete skill 	p/1/c/
6459243Sobrien    complete dde	p/1/c/ 
6559243Sobrien    complete adb	c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
6659243Sobrien    complete sdb	p/1/c/
6759243Sobrien    complete dbx	c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
6859243Sobrien    complete xdb	p/1/c/
6959243Sobrien    complete gdb	n/-d/d/ n/*/c/
7059243Sobrien    complete ups	p/1/c/
7159243Sobrien    complete set	'c/*=/f/' 'p/1/s/=' 'n/=/f/'
7259243Sobrien    complete unset	n/*/s/
7359243Sobrien    complete alias 	p/1/a/		# only aliases are valid
7459243Sobrien    complete unalias	n/*/a/
7559243Sobrien    complete xdvi 	n/*/f:*.dvi/	# Only files that match *.dvi
7659243Sobrien    complete dvips 	n/*/f:*.dvi/
7759243Sobrien    complete tex 	n/*/f:*.tex/	# Only files that match *.tex
7859243Sobrien    complete latex 	n/*/f:*.{tex,ltx}/
7959243Sobrien    complete su		c/--/"(login fast preserve-environment command shell \
8059243Sobrien			help version)"/	c/-/"(f l m p c s -)"/ \
8159243Sobrien			n/{-c,--command}/c/ \
8259243Sobrien			n@{-s,--shell}@'`cat /etc/shells`'@ n/*/u/
8359243Sobrien    complete cc 	c/-[IL]/d/ \
8459243Sobrien              c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
8559243Sobrien			c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
8659243Sobrien    complete acc 	c/-[IL]/d/ \
8759243Sobrien       c@-l@'`\ls -1 /usr/lang/SC1.0/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
8859243Sobrien			c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
8959243Sobrien    complete gcc 	c/-[IL]/d/ \
9059243Sobrien		 	c/-f/"(caller-saves cse-follow-jumps delayed-branch \
9159243Sobrien		               elide-constructors expensive-optimizations \
9259243Sobrien			       float-store force-addr force-mem inline \
9359243Sobrien			       inline-functions keep-inline-functions \
9459243Sobrien			       memoize-lookups no-default-inline \
9559243Sobrien			       no-defer-pop no-function-cse omit-frame-pointer \
9659243Sobrien			       rerun-cse-after-loop schedule-insns \
9759243Sobrien			       schedule-insns2 strength-reduce \
9859243Sobrien			       thread-jumps unroll-all-loops \
9959243Sobrien			       unroll-loops syntax-only all-virtual \
10059243Sobrien			       cond-mismatch dollars-in-identifiers \
10159243Sobrien			       enum-int-equiv no-asm no-builtin \
10259243Sobrien			       no-strict-prototype signed-bitfields \
10359243Sobrien			       signed-char this-is-variable unsigned-bitfields \
10459243Sobrien			       unsigned-char writable-strings call-saved-reg \
10559243Sobrien			       call-used-reg fixed-reg no-common \
10659243Sobrien			       no-gnu-binutils nonnull-objects \
10759243Sobrien			       pcc-struct-return pic PIC shared-data \
10859243Sobrien			       short-enums short-double volatile)"/ \
10959243Sobrien		 	c/-W/"(all aggregate-return cast-align cast-qual \
11059243Sobrien		      	       comment conversion enum-clash error format \
11159243Sobrien		      	       id-clash-len implicit missing-prototypes \
11259243Sobrien		      	       no-parentheses pointer-arith return-type shadow \
11359243Sobrien		      	       strict-prototypes switch uninitialized unused \
11459243Sobrien		      	       write-strings)"/ \
11559243Sobrien		 	c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd \
11659243Sobrien			       short c68000 c68020 soft-float g gnu unix fpu \
11759243Sobrien			       no-epilogue)"/ \
11859243Sobrien		 	c/-d/"(D M N)"/ \
11959243Sobrien		 	c/-/"(f W vspec v vpath ansi traditional \
12059243Sobrien			      traditional-cpp trigraphs pedantic x o l c g L \
12159243Sobrien			      I D U O O2 C E H B b V M MD MM i dynamic \
12259243Sobrien			      nodtdlib static nostdinc undef)"/ \
12359243Sobrien		 	c/-l/f:*.a/ \
12459243Sobrien		 	n/*/f:*.{c,C,cc,o,a,s,i}/
12559243Sobrien    complete g++ 	n/*/f:*.{C,cc,o,s,i}/
12659243Sobrien    complete CC 	n/*/f:*.{C,cc,o,s,i}/
12759243Sobrien    complete rm 	c/--/"(directory force interactive verbose \
12859243Sobrien			recursive help version)"/ c/-/"(d f i v r R -)"/ \
12959243Sobrien			n/*/f:^*.{c,cc,C,h,in}/	# Protect precious files
13059243Sobrien    complete vi 	n/*/f:^*.[oa]/
13159243Sobrien    complete bindkey    N/-a/b/ N/-c/c/ n/-[ascr]/'x:<key-sequence>'/ \
13259243Sobrien			n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/\
13359243Sobrien			n/-k/"(left right up down)"/ p/2-/b/ \
13459243Sobrien			p/1/'x:<key-sequence or option>'/
13559243Sobrien
13659243Sobrien    complete find 	n/-fstype/"(nfs 4.2)"/ n/-name/f/ \
13759243Sobrien		  	n/-type/"(c b d f p l s)"/ n/-user/u/ n/-group/g/ \
13859243Sobrien			n/-exec/c/ n/-ok/c/ n/-cpio/f/ n/-ncpio/f/ n/-newer/f/ \
13959243Sobrien		  	c/-/"(fstype name perm prune type user nouser \
14059243Sobrien		  	     group nogroup size inum atime mtime ctime exec \
14159243Sobrien			     ok print ls cpio ncpio newer xdev depth \
14259243Sobrien			     daystart follow maxdepth mindepth noleaf version \
14359243Sobrien			     anewer cnewer amin cmin mmin true false uid gid \
14459243Sobrien			     ilname iname ipath iregex links lname empty path \
14559243Sobrien			     regex used xtype fprint fprint0 fprintf \
14659243Sobrien			     print0 printf not a and o or)"/ \
14759243Sobrien			     n/*/d/
14859243Sobrien
14959243Sobrien    complete -%*	c/%/j/			# fill in the jobs builtin
15059243Sobrien    complete {fg,bg,stop}	c/%/j/ p/1/"(%)"//
15159243Sobrien
15259243Sobrien    complete limit	c/-/"(h)"/ n/*/l/
15359243Sobrien    complete unlimit	c/-/"(h)"/ n/*/l/
15459243Sobrien
15559243Sobrien    complete -co*	p/0/"(compress)"/	# make compress completion
15659243Sobrien						# not ambiguous
15759243Sobrien    complete zcat	n/*/f:*.Z/
15859243Sobrien    complete nm		n/*/f:^*.{h,C,c,cc}/
15959243Sobrien
16059243Sobrien    complete finger	c/*@/\$hosts/ n/*/u/@ 
16159243Sobrien    complete ping	p/1/\$hosts/
16259243Sobrien    complete traceroute	p/1/\$hosts/
16359243Sobrien
16459243Sobrien    complete {talk,ntalk,phone}	p/1/'`users | tr " " "\012" | uniq`'/ \
16559243Sobrien		n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/
16659243Sobrien
16759243Sobrien    complete ftp	c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/
16859243Sobrien
16959243Sobrien    # this one is simple...
17059243Sobrien    #complete rcp c/*:/f/ C@[./\$~]*@f@ n/*/\$hosts/:
17159243Sobrien    # From Michael Schroeder <mlschroe@immd4.informatik.uni-erlangen.de> 
17259243Sobrien    # This one will rsh to the file to fetch the list of files!
17359243Sobrien    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/:'
17459243Sobrien
17559243Sobrien    complete dd c/--/"(help version)"/ c/[io]f=/f/ \
17659243Sobrien		c/conv=*,/"(ascii ebcdic ibm block unblock \
17759243Sobrien			    lcase notrunc ucase swab noerror sync)"/,\
17859243Sobrien		c/conv=/"(ascii ebcdic ibm block unblock \
17959243Sobrien			  lcase notrunc ucase swab noerror sync)"/,\
18059243Sobrien	        c/*=/x:'<number>'/ \
18159243Sobrien		n/*/"(if of conv ibs obs bs cbs files skip file seek count)"/=
18259243Sobrien
18359243Sobrien    complete nslookup   p/1/x:'<host>'/ p/2/\$hosts/
18459243Sobrien
18559243Sobrien    complete ar c/[dmpqrtx]/"(c l o u v a b i)"/ p/1/"(d m p q r t x)"// \
18659243Sobrien		p/2/f:*.a/ p/*/f:*.o/
18759243Sobrien
18859243Sobrien    # these should be merged with the MH completion hacks below - jgotts
18959243Sobrien    complete {sprev,snext} \
19059243Sobrien		c@+@F:$HOME/Mail/@
19159243Sobrien
19259243Sobrien    # these and interrupt handling from Jaap Vermeulen <jaap@sequent.com>
19359243Sobrien    complete {rexec,rxexec,rxterm,rmterm} \
19459243Sobrien			'p/1/$hosts/' 'c/-/(l L E)/' 'n/-l/u/' 'n/-L/f/' \
19559243Sobrien			'n/-E/e/' 'n/*/c/'
19659243Sobrien    complete kill	'c/-/S/' 'c/%/j/' \
19759243Sobrien			'n/*/`ps -u $LOGNAME | awk '"'"'{print $1}'"'"'`/'
19859243Sobrien
19959243Sobrien    # these from Marc Horowitz <marc@cam.ov.com>
20059243Sobrien    complete attach 'n/-mountpoint/d/' 'n/-m/d/' 'n/-type/(afs nfs rvd ufs)/' \
20159243Sobrien		    'n/-t/(afs nfs rvd ufs)/' 'n/-user/u/' 'n/-U/u/' \
20259243Sobrien		    'c/-/(verbose quiet force printpath lookup debug map \
20359243Sobrien			  nomap remap zephyr nozephyr readonly write \
20459243Sobrien			  mountpoint noexplicit explicit type mountoptions \
20559243Sobrien			  nosetuid setuid override skipfsck lock user host)/' \
20659243Sobrien		    'n/-e/f/' 'n/*/()/'
20759243Sobrien    complete hesinfo	'p/1/u/' \
20859243Sobrien			'p/2/(passwd group uid grplist pcap pobox cluster \
20959243Sobrien			      filsys sloc service)/'
21059243Sobrien
21159243Sobrien    # these from E. Jay Berkenbilt <ejb@ERA.COM>
21259243Sobrien    # = isn't always followed by a filename or a path anymore - jgotts
21359243Sobrien    complete ./configure 'c/--*=/f/' 'c/--{cache-file,prefix,exec-prefix,\
21459243Sobrien    				bindir,sbindir,libexecdir,datadir,\
21559243Sobrien				sysconfdir,sharedstatedir,localstatedir,\
21659243Sobrien				libdir,includedir,oldincludedir,infodir,\
21759243Sobrien				mandir,srcdir}/(=)//' \
21859243Sobrien			 'c/--/(cache-file verbose prefix exec-prefix bindir \
21959243Sobrien			 	sbindir libexecdir datadir sysconfdir \
22059243Sobrien				sharedstatedir localstatedir libdir \
22159243Sobrien				includedir oldincludedir infodir mandir \
22259243Sobrien				srcdir)//'
22359243Sobrien    complete gs 'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc \
22459243Sobrien			      dfaxhigh dfaxlow laserjet ljet4 sparc pbm \
22559243Sobrien			      pbmraw pgm pgmraw ppm ppmraw bit)/' \
22659243Sobrien		'c/-sOutputFile=/f/' 'c/-s/(DEVICE OutputFile)/=' \
22759243Sobrien		'c/-d/(NODISPLAY NOPLATFONTS NOPAUSE)/' 'n/*/f/'
22859243Sobrien    complete perl	'n/-S/c/'
22959243Sobrien    complete printenv	'n/*/e/'
23059243Sobrien    complete sccs	p/1/"(admin cdc check clean comb deledit delget \
23159243Sobrien			delta diffs edit enter fix get help info \
23259243Sobrien			print prs prt rmdel sccsdiff tell unedit \
23359243Sobrien			unget val what)"/
23459243Sobrien    complete setenv	'p/1/e/' 'c/*:/f/'
23559243Sobrien
23659243Sobrien    # these and method of setting hosts from Kimmo Suominen <kim@tac.nyc.ny.us>
23759243Sobrien    if ( -f $HOME/.mh_profile && -x "`which folders`" ) then 
23859243Sobrien
23959243Sobrien    if ( ! $?FOLDERS ) setenv FOLDERS "`folders -fast -recurse`"
24059243Sobrien    if ( ! $?MHA )     setenv MHA     "`ali | sed -e '/^ /d' -e 's/:.*//'`"
24159243Sobrien
24259243Sobrien    set folders = ( $FOLDERS )
24359243Sobrien    set mha = ( $MHA )
24459243Sobrien
24559243Sobrien    complete ali \
24659243Sobrien        'c/-/(alias nolist list nonormalize normalize nouser user help)/' \
24759243Sobrien        'n,-alias,f,'
24859243Sobrien
24959243Sobrien    complete anno \
25059243Sobrien        'c/-/(component noinplace inplace nodate date text help)/' \
25159243Sobrien        'c,+,$folders,'  \
25259243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
25359243Sobrien
25459243Sobrien    complete burst \
25559243Sobrien        'c/-/(noinplace inplace noquiet quiet noverbose verbose help)/' \
25659243Sobrien        'c,+,$folders,'  \
25759243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
25859243Sobrien
25959243Sobrien    complete comp \
26059243Sobrien        'c/-/(draftfolder draftmessage nodraftfolder editor noedit file form nouse use whatnowproc nowhatnowproc help)/' \
26159243Sobrien        'c,+,$folders,'  \
26259243Sobrien        'n,-whatnowproc,c,'  \
26359243Sobrien        'n,-file,f,'\
26459243Sobrien        'n,-form,f,'\
26559243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
26659243Sobrien
26759243Sobrien    complete dist \
26859243Sobrien        'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit form noinplace inplace whatnowproc nowhatnowproc help)/' \
26959243Sobrien        'c,+,$folders,'  \
27059243Sobrien        'n,-whatnowproc,c,'  \
27159243Sobrien        'n,-form,f,'\
27259243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
27359243Sobrien
27459243Sobrien    complete folder \
27559243Sobrien        'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
27659243Sobrien        'c,+,$folders,'  \
27759243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
27859243Sobrien
27959243Sobrien    complete folders \
28059243Sobrien        'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
28159243Sobrien        'c,+,$folders,'  \
28259243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
28359243Sobrien
28459243Sobrien    complete forw \
28559243Sobrien        'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit filter form noformat format noinplace inplace digest issue volume whatnowproc nowhatnowproc help)/' \
28659243Sobrien        'c,+,$folders,'  \
28759243Sobrien        'n,-whatnowproc,c,'  \
28859243Sobrien        'n,-filter,f,'\
28959243Sobrien        'n,-form,f,'\
29059243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
29159243Sobrien
29259243Sobrien    complete inc \
29359243Sobrien        'c/-/(audit file noaudit nochangecur changecur file form format nosilent silent notruncate truncate width help)/' \
29459243Sobrien        'c,+,$folders,'  \
29559243Sobrien        'n,-audit,f,'\
29659243Sobrien        'n,-form,f,'
29759243Sobrien
29859243Sobrien    complete mark \
29959243Sobrien        'c/-/(add delete list sequence nopublic public nozero zero help)/' \
30059243Sobrien        'c,+,$folders,'  \
30159243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
30259243Sobrien
30359243Sobrien    complete mhmail \
30459243Sobrien        'c/-/(body cc from subject help)/' \
30559243Sobrien        'n,-cc,$mha,'  \
30659243Sobrien        'n,-from,$mha,'  \
30759243Sobrien        'n/*/$mha/'
30859243Sobrien
30959243Sobrien    complete mhpath \
31059243Sobrien        'c/-/(help)/' \
31159243Sobrien        'c,+,$folders,'  \
31259243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
31359243Sobrien
31459243Sobrien    complete msgchk \
31559243Sobrien        'c/-/(nodate date nonotify notify help)/' 
31659243Sobrien
31759243Sobrien    complete msh \
31859243Sobrien        'c/-/(prompt noscan scan notopcur topcur help)/' 
31959243Sobrien
32059243Sobrien    complete next \
32159243Sobrien        'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
32259243Sobrien        'c,+,$folders,'  \
32359243Sobrien        'n,-moreproc,c,'  \
32459243Sobrien        'n,-showproc,c,'  \
32559243Sobrien        'n,-form,f,'
32659243Sobrien
32759243Sobrien    complete packf \
32859243Sobrien        'c/-/(file help)/' \
32959243Sobrien        'c,+,$folders,'  \
33059243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
33159243Sobrien
33259243Sobrien    complete pick \
33359243Sobrien        'c/-/(and or not lbrace rbrace cc date from search subject to othercomponent after before datefield sequence nopublic public nozero zero nolist list help)/' \
33459243Sobrien        'c,+,$folders,'  \
33559243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
33659243Sobrien
33759243Sobrien    complete prev \
33859243Sobrien        'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
33959243Sobrien        'c,+,$folders,'  \
34059243Sobrien        'n,-moreproc,c,'  \
34159243Sobrien        'n,-showproc,c,'  \
34259243Sobrien        'n,-form,f,'
34359243Sobrien
34459243Sobrien    complete prompter \
34559243Sobrien        'c/-/(erase kill noprepend prepend norapid rapid nodoteof doteof help)/' 
34659243Sobrien
34759243Sobrien    complete refile \
34859243Sobrien        'c/-/(draft nolink link nopreserve preserve src file help)/' \
34959243Sobrien        'c,+,$folders,'  \
35059243Sobrien        'n,-file,f,'\
35159243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
35259243Sobrien
35359243Sobrien    complete rmf \
35459243Sobrien        'c/-/(nointeractive interactive help)/' \
35559243Sobrien        'c,+,$folders,'  
35659243Sobrien
35759243Sobrien    complete rmm \
35859243Sobrien        'c/-/(help)/' \
35959243Sobrien        'c,+,$folders,'  \
36059243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
36159243Sobrien
36259243Sobrien    complete scan \
36359243Sobrien        'c/-/(noclear clear form format noheader header width noreverse reverse file help)/' \
36459243Sobrien        'c,+,$folders,'  \
36559243Sobrien        'n,-form,f,'\
36659243Sobrien        'n,-file,f,'\
36759243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
36859243Sobrien
36959243Sobrien    complete send \
37059243Sobrien        'c/-/(alias draft draftfolder draftmessage nodraftfolder filter nofilter noformat format noforward forward nomsgid msgid nopush push noverbose verbose nowatch watch width help)/' \
37159243Sobrien        'n,-alias,f,'\
37259243Sobrien        'n,-filter,f,'
37359243Sobrien
37459243Sobrien    complete show \
37559243Sobrien        'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
37659243Sobrien        'c,+,$folders,'  \
37759243Sobrien        'n,-moreproc,c,'  \
37859243Sobrien        'n,-showproc,c,'  \
37959243Sobrien        'n,-form,f,'\
38059243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
38159243Sobrien
38259243Sobrien    complete sortm \
38359243Sobrien        'c/-/(datefield textfield notextfield limit nolimit noverbose verbose help)/' \
38459243Sobrien        'c,+,$folders,'  \
38559243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
38659243Sobrien
38759243Sobrien    complete vmh \
38859243Sobrien        'c/-/(prompt vmhproc novmhproc help)/' \
38959243Sobrien        'n,-vmhproc,c,'  
39059243Sobrien
39159243Sobrien    complete whatnow \
39259243Sobrien        'c/-/(draftfolder draftmessage nodraftfolder editor noedit prompt help)/' 
39359243Sobrien
39459243Sobrien    complete whom \
39559243Sobrien        'c/-/(alias nocheck check draft draftfolder draftmessage nodraftfolder help)/' \
39659243Sobrien        'n,-alias,f,'
39759243Sobrien
39859243Sobrien    complete plum \
39959243Sobrien        'c/-/()/' \
40059243Sobrien        'c,+,$folders,'  \
40159243Sobrien        'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
40259243Sobrien
40359243Sobrien    complete mail \
40459243Sobrien        'c/-/()/' \
40559243Sobrien        'n/*/$mha/'
40659243Sobrien
40759243Sobrien    endif
40859243Sobrien
40959243Sobrien    #from Dan Nicolaescu <dann@ics.uci.edu>
41059243Sobrien    if ( $?MODULESHOME ) then
41159243Sobrien
41259243Sobrien	alias Compl_module ' set q = "$MODULEPATH:as/:/ /" ; find $q -name .version -o -name .modulea\* -prune -o -print  | sed `echo "-e s@"$MODULEPATH:as%:%/\*@@g -e s@%"/\*@@g"`'
41359243Sobrien
41459243Sobrien	complete module 'p%1%(add load unload switch display avail use unuse update purge list clear help initadd initrm initswitch initlist initclear)%' \
41559243Sobrien    'n%unload%`echo "$LOADEDMODULES:as/:/ /"`%' \
41659243Sobrien    'n%{lo*,sw*,di*,he*,inita*,initr*,inits*}%`eval Compl_module`%' \
41759243Sobrien    'N%{sw*,initsw*}%`eval Compl_module`%' 'C%-%(-append)%' 'n%{use,unu*,av*}%d%' 'n%-append%d%' \
41859243Sobrien    'C%[^-]*%`eval Compl_module`%'
41959243Sobrien    endif
42059243Sobrien
42159243Sobrien    # these from Tom Warzeka <waz@quahog.npt.nuwc.navy.mil>
42259243Sobrien    # you may need to set the following variables for your host
42359243Sobrien    set _elispdir = /usr/local/share/emacs/20.2/lisp # GNU Emacs lisp directory
42459243Sobrien    set _maildir = /var/spool/mail  # Post Office: /var/spool/mail or /usr/mail
42559243Sobrien    set _ypdir  = /var/yp	# directory where NIS (YP) maps are kept
42659243Sobrien    set _domain = "`domainname`"
42759243Sobrien
42859243Sobrien    # this one works but is slow and doesn't descend into subdirectories
42959243Sobrien    # complete	cd	C@[./\$~]*@d@ \
43059243Sobrien    #			p@1@'`\ls -1F . $cdpath | grep /\$ | sort -u`'@ n@*@n@
43159243Sobrien
43259243Sobrien    if ( -r /etc/shells ) then
43359243Sobrien        complete setenv	p@1@e@ n@DISPLAY@\$hosts@: n@SHELL@'`cat /etc/shells`'@
43459243Sobrien    else
43559243Sobrien	complete setenv	p@1@e@ n@DISPLAY@\$hosts@:
43659243Sobrien    endif
43759243Sobrien    complete unsetenv	n/*/e/
43859243Sobrien
43959243Sobrien    if (-r $HOME/.mailrc) then
44059243Sobrien        complete mail	c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
44159243Sobrien			c@+@F:$HOME/Mail@ C@[./\$~]@f@ n/-s/x:'<subject>'/ \
44259243Sobrien			n@-u@T:$_maildir@ n/-f/f/ \
44359243Sobrien			n@*@'`sed -n s/alias//p $HOME/.mailrc | tr -s " " "	" | cut -f 2`'@
44459243Sobrien    else
44559243Sobrien        complete mail	c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
44659243Sobrien			c@+@F:$HOME/Mail@ C@[./\$~]@f@ n/-s/x:'<subject>'/ \
44759243Sobrien			n@-u@T:$_maildir@ n/-f/f/ n/*/u/
44859243Sobrien    endif
44959243Sobrien
45059243Sobrien    complete man	    n@1@'`\ls -1 /usr/man/man1 | sed s%\\.1.\*\$%%`'@ \
45159243Sobrien			    n@2@'`\ls -1 /usr/man/man2 | sed s%\\.2.\*\$%%`'@ \
45259243Sobrien			    n@3@'`\ls -1 /usr/man/man3 | sed s%\\.3.\*\$%%`'@ \
45359243Sobrien			    n@4@'`\ls -1 /usr/man/man4 | sed s%\\.4.\*\$%%`'@ \
45459243Sobrien			    n@5@'`\ls -1 /usr/man/man5 | sed s%\\.5.\*\$%%`'@ \
45559243Sobrien			    n@6@'`\ls -1 /usr/man/man6 | sed s%\\.6.\*\$%%`'@ \
45659243Sobrien			    n@7@'`\ls -1 /usr/man/man7 | sed s%\\.7.\*\$%%`'@ \
45759243Sobrien			    n@8@'`\ls -1 /usr/man/man8 | sed s%\\.8.\*\$%%`'@ \
45859243Sobrien    n@9@'`[ -r /usr/man/man9 ] && \ls -1 /usr/man/man9 | sed s%\\.9.\*\$%%`'@ \
45959243Sobrien    n@0@'`[ -r /usr/man/man0 ] && \ls -1 /usr/man/man0 | sed s%\\.0.\*\$%%`'@ \
46059243Sobrien  n@new@'`[ -r /usr/man/mann ] && \ls -1 /usr/man/mann | sed s%\\.n.\*\$%%`'@ \
46159243Sobrien  n@old@'`[ -r /usr/man/mano ] && \ls -1 /usr/man/mano | sed s%\\.o.\*\$%%`'@ \
46259243Sobrienn@local@'`[ -r /usr/man/manl ] && \ls -1 /usr/man/manl | sed s%\\.l.\*\$%%`'@ \
46359243Sobrienn@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
46459243Sobrien		c/-/"(- f k M P s t)"/ n/-f/c/ n/-k/x:'<keyword>'/ n/-[MP]/d/ \
46559243Sobrien		N@-[MP]@'`\ls -1 $:-1/man? | sed s%\\..\*\$%%`'@ n/*/c/
46659243Sobrien
46759243Sobrien    complete ps	        c/-t/x:'<tty>'/ c/-/"(a c C e g k l S t u v w x)"/ \
46859243Sobrien			n/-k/x:'<kernel>'/ N/-k/x:'<core_file>'/ n/*/x:'<PID>'/
46959243Sobrien    complete compress	c/-/"(c f v b)"/ n/-b/x:'<max_bits>'/ n/*/f:^*.Z/
47059243Sobrien    complete uncompress	c/-/"(c f v)"/                        n/*/f:*.Z/
47159243Sobrien
47259243Sobrien    complete xhost	c/[+-]/\$hosts/ n/*/\$hosts/
47359243Sobrien
47459243Sobrien    # these conform to the latest GNU versions available at press time ...
47559243Sobrien    # updates by John Gotts <jgotts@engin.umich.edu>
47659243Sobrien
47759243Sobrien    complete emacs	c/-/"(batch d f funcall i insert kill l load \
47859243Sobrien			no-init-file nw q t u user)"/ c/+/x:'<line_number>'/ \
47959243Sobrien			n/-d/x:'<display>'/ n/-f/x:'<lisp_function>'/ n/-i/f/ \
48059243Sobrien			n@-l@F:$_elispdir@ n/-t/x:'<terminal>'/ \
48159243Sobrien			n/-u/u/ n/*/f:^*[\#~]/
48259243Sobrien
48359243Sobrien    complete gzcat	c/--/"(force help license quiet version)"/ \
48459243Sobrien			c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
48559243Sobrien    complete gzip	c/--/"(stdout to-stdout decompress uncompress \
48659243Sobrien			force help list license no-name quiet recurse \
48759243Sobrien			suffix test verbose version fast best)"/ \
48859243Sobrien			c/-/"(c d f h l L n q r S t v V 1 2 3 4 5 6 7 8 9 -)"/\
48959243Sobrien			n/{-S,--suffix}/x:'<file_name_suffix>'/ \
49059243Sobrien			n/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
49159243Sobrien			N/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
49259243Sobrien			n/*/f:^*.{gz,Z,z,zip,taz,tgz}/
49359243Sobrien    complete {gunzip,ungzip} c/--/"(stdout to-stdout force help list license \
49459243Sobrien			no-name quiet recurse suffix test verbose version)"/ \
49559243Sobrien			c/-/"(c f h l L n q r S t v V -)"/ \
49659243Sobrien			n/{-S,--suffix}/x:'<file_name_suffix>'/ \
49759243Sobrien			n/*/f:*.{gz,Z,z,zip,taz,tgz}/
49859243Sobrien    complete zgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
49959243Sobrien			c/-/"(A b B c C e f h i l n s v V w x)"/ \
50059243Sobrien			p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
50159243Sobrien			n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
50259243Sobrien    complete zegrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
50359243Sobrien			c/-/"(A b B c C e f h i l n s v V w x)"/ \
50459243Sobrien			p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
50559243Sobrien			n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
50659243Sobrien    complete zfgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
50759243Sobrien			c/-/"(A b B c C e f h i l n s v V w x)"/ \
50859243Sobrien			p/1/x:'<fixed_string>'/ N/-*e/f/ \
50959243Sobrien			n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
51059243Sobrien    complete znew	c/-/"(f t v 9 P K)"/ n/*/f:*.Z/
51159243Sobrien    complete zmore	n/*/f:*.{gz,Z,z,zip}/
51259243Sobrien    complete zfile	n/*/f:*.{gz,Z,z,zip,taz,tgz}/
51359243Sobrien    complete ztouch	n/*/f:*.{gz,Z,z,zip,taz,tgz}/
51459243Sobrien    complete zforce	n/*/f:^*.{gz,tgz}/
51559243Sobrien
51659243Sobrien    complete grep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
51759243Sobrien			c/--/"(extended-regexp fixed-regexp basic-regexp \
51859243Sobrien			regexp file ignore-case word-regexp line-regexp \
51959243Sobrien			no-messages revert-match version help byte-offset \
52059243Sobrien			line-number with-filename no-filename quiet silent \
52159243Sobrien			text directories recursive files-without-match \
52259243Sobrien			files-with-matches count before-context after-context \
52359243Sobrien			context binary unix-byte-offsets)"/ \
52459243Sobrien			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 \
52559243Sobrien				v w x)"/ \
52659243Sobrien			p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
52759243Sobrien			n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
52859243Sobrien    complete egrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
52959243Sobrien			c/--/"(extended-regexp fixed-regexp basic-regexp \
53059243Sobrien			regexp file ignore-case word-regexp line-regexp \
53159243Sobrien			no-messages revert-match version help byte-offset \
53259243Sobrien			line-number with-filename no-filename quiet silent \
53359243Sobrien			text directories recursive files-without-match \
53459243Sobrien			files-with-matches count before-context after-context \
53559243Sobrien			context binary unix-byte-offsets)"/ \
53659243Sobrien			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 \
53759243Sobrien				v w x)"/ \
53859243Sobrien			p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
53959243Sobrien			n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
54059243Sobrien    complete fgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
54159243Sobrien			c/--/"(extended-regexp fixed-regexp basic-regexp \
54259243Sobrien			regexp file ignore-case word-regexp line-regexp \
54359243Sobrien			no-messages revert-match version help byte-offset \
54459243Sobrien			line-number with-filename no-filename quiet silent \
54559243Sobrien			text directories recursive files-without-match \
54659243Sobrien			files-with-matches count before-context after-context \
54759243Sobrien			context binary unix-byte-offsets)"/ \
54859243Sobrien			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 \
54959243Sobrien				v w x)"/ \
55059243Sobrien			p/1/x:'<fixed_string>'/ N/-*e/f/ \
55159243Sobrien			n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
55259243Sobrien
55359243Sobrien    complete users	c/--/"(help version)"/ p/1/x:'<accounting_file>'/
55459243Sobrien    complete who	c/--/"(heading idle count mesg message writable help \
55559243Sobrien    			version)"/ c/-/"(H i m q s T w u -)"/ \
55659243Sobrien			p/1/x:'<accounting_file>'/ n/am/"(i)"/ n/are/"(you)"/
55759243Sobrien
55859243Sobrien    complete chown	c/--/"(changes dereference no-dereference silent \
55959243Sobrien    			quiet reference recursive verbose help version)"/ \
56059243Sobrien			c/-/"(c f h R v -)"/ C@[./\$~]@f@ c/*[.:]/g/ \
56159243Sobrien			n/-/u/. p/1/u/. n/*/f/
56259243Sobrien    complete chgrp	c/--/"(changes no-dereference silent quiet reference \
56359243Sobrien    			recursive verbose help version)"/ \
56459243Sobrien			c/-/"(c f h R v -)"/ n/-/g/ p/1/g/ n/*/f/
56559243Sobrien    complete chmod	c/--/"(changes silent quiet verbose reference \
56659243Sobrien    			recursive help version)"/ c/-/"(c f R v)"/
56759243Sobrien    complete df		c/--/"(all block-size human-readable si inodes \
56859243Sobrien			kilobytes local megabytes no-sync portability sync \
56959243Sobrien			type print-type exclude-type help version)"/ \
57059243Sobrien			c/-/"(a H h i k l m P T t v x)"/
57159243Sobrien    complete du		c/--/"(all block-size bytes total dereference-args \
57259243Sobrien    			human-readable si kilobytes count-links dereference \
57359243Sobrien			megabytes separate-dirs summarize one-file-system \
57459243Sobrien			exclude-from exclude max-depth help version"/ \
57559243Sobrien			c/-/"(a b c D H h k L l m S s X x)"/
57659243Sobrien
57759243Sobrien    complete cat	c/--/"(number-nonblank number squeeze-blank show-all \
57859243Sobrien			show-nonprinting show-ends show-tabs help version)"/ \
57959243Sobrien			c/-/"(A b E e n s T t u v -)"/ n/*/f/
58059243Sobrien    complete mv		c/--/"(backup force interactive update verbose suffix \
58159243Sobrien			version-control help version)"/ \
58259243Sobrien			c/-/"(b f i S u V v -)"/ \
58359243Sobrien			n/{-S,--suffix}/x:'<suffix>'/ \
58459243Sobrien			n/{-V,--version-control}/"(t numbered nil existing \
58559243Sobrien			never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
58659243Sobrien    complete cp		c/--/"(archive backup no-dereference force \
58759243Sobrien    			interactive link preserve parents sparse recursive \
58859243Sobrien			symbolic-link suffix update verbose version-control \
58959243Sobrien			one-file-system help version)"/ \
59059243Sobrien			c/-/"(a b d f i l P p R r S s u V v x -)"/ \
59159243Sobrien			n/-*r/d/ n/{-S,--suffix}/x:'<suffix>'/ \
59259243Sobrien			n/{-V,--version-control}/"(t numbered nil existing \
59359243Sobrien			never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
59459243Sobrien    complete ln		c/--/"(backup directory force no-dereference \
59559243Sobrien    			interactive symbolic suffix verbose version-control \
59659243Sobrien			help version)"/ \
59759243Sobrien			c/-/"(b d F f i n S s V v -)"/ \
59859243Sobrien			n/{-S,--suffix}/x:'<suffix>'/ \
59959243Sobrien			n/{-V,--version-control}/"(t numbered nil existing \
60059243Sobrien			never simple)"/ n/-/f/ N/-/x:'<link_name>'/ \
60159243Sobrien			p/1/f/ p/2/x:'<link_name>'/
60259243Sobrien    complete touch	c/--/"(date reference time help version)"/ \
60359243Sobrien			c/-/"(a c d f m r t -)"/ \
60459243Sobrien			n/{-d,--date}/x:'<date_string>'/ \
60559243Sobrien			c/--time/"(access atime mtime modify use)"/ \
60659243Sobrien			n/{-r,--file}/f/ n/-t/x:'<time_stamp>'/ n/*/f/
60759243Sobrien    complete mkdir	c/--/"(mode parents verbose help version)"/ \
60859243Sobrien    			c/-/"(p m -)"/ \
60959243Sobrien			n/{-m,--mode}/x:'<mode>'/ n/*/d/
61059243Sobrien    complete rmdir	c/--/"(ignore-fail-on-non-empty parents verbose help \
61159243Sobrien    			version)"/ c/-/"(p -)"/ n/*/d/
61259243Sobrien
61359243Sobrien    complete tar	c/-[Acru]*/"(b B C f F g G h i l L M N o P \
61459243Sobrien			R S T v V w W X z Z)"/ \
61559243Sobrien			c/-[dtx]*/"( B C f F g G i k K m M O p P \
61659243Sobrien			R s S T v w x X z Z)"/ \
61759243Sobrien			p/1/"(A c d r t u x -A -c -d -r -t -u -x \
61859243Sobrien			--catenate --concatenate --create --diff --compare \
61959243Sobrien			--delete --append --list --update --extract --get \
62059243Sobrien			--help --version)"/ \
62159243Sobrien			c/--/"(catenate concatenate create diff compare \
62259243Sobrien			delete append list update extract get atime-preserve \
62359243Sobrien			block-size read-full-blocks directory checkpoint file \
62459243Sobrien			force-local info-script new-volume-script incremental \
62559243Sobrien			listed-incremental dereference ignore-zeros \
62659243Sobrien			ignore-failed-read keep-old-files starting-file \
62759243Sobrien			one-file-system tape-length modification-time \
62859243Sobrien			multi-volume after-date newer old-archive portability \
62959243Sobrien			to-stdout same-permissions preserve-permissions \
63059243Sobrien			absolute-paths preserve record-number remove-files \
63159243Sobrien			same-order preserve-order same-owner sparse \
63259243Sobrien			files-from null totals verbose label version \
63359243Sobrien			interactive confirmation verify exclude exclude-from \
63459243Sobrien			compress uncompress gzip ungzip use-compress-program \
63559243Sobrien			block-compress help version)"/ \
63659243Sobrien			c/-/"(b B C f F g G h i k K l L m M N o O p P R s S \
63759243Sobrien			T v V w W X z Z 0 1 2 3 4 5 6 7 -)"/ \
63859243Sobrien			n/-c*f/x:'<new_tar_file, device_file, or "-">'/ \
63959243Sobrien			n/{-[Adrtux]*f,--file}/f:*.tar/ \
64059243Sobrien			N/{-x*f,--file}/'`tar -tf $:-1`'/ \
64159243Sobrien			n/--use-compress-program/c/ \
64259243Sobrien			n/{-b,--block-size}/x:'<block_size>'/ \
64359243Sobrien			n/{-V,--label}/x:'<volume_label>'/ \
64459243Sobrien			n/{-N,--{after-date,newer}}/x:'<date>'/ \
64559243Sobrien			n/{-L,--tape-length}/x:'<tape_length_in_kB>'/ \
64659243Sobrien			n/{-C,--directory}/d/ \
64759243Sobrien			N/{-C,--directory}/'`\ls $:-1`'/ \
64859243Sobrien			n/-[0-7]/"(l m h)"/
64959243Sobrien
65059243Sobrien    # SVR4 filesystems
65159243Sobrien    #complete  mount	c/-/"(a F m o O p r v V)"/ n/-p/n/ n/-v/n/ \
65259243Sobrien    #			n/-o/x:'<FSType_options>'/ \
65359243Sobrien    #			n@-F@'`\ls -1 /usr/lib/fs`'@ \
65459243Sobrien    #			n@*@'`grep -v "^#" /etc/vfstab | tr -s " " "	 " | cut -f 3`'@
65559243Sobrien    #complete umount	c/-/"(a o V)"/ n/-o/x:'<FSType_options>'/ \
65659243Sobrien    #			n/*/'`mount | cut -d " " -f 1`'/
65759243Sobrien    #complete  mountall	c/-/"(F l r)"/ n@-F@'`\ls -1 /usr/lib/fs`'@
65859243Sobrien    #complete umountall	c/-/"(F h k l r s)"/ n@-F@'`\ls -1 /usr/lib/fs`'@ \
65959243Sobrien    #			n/-h/'`df -k | cut -s -d ":" -f 1 | sort -u`'/
66059243Sobrien    # BSD 4.3 filesystems
66159243Sobrien    complete  mount	c/-/"(a r t v)"/ n/-t/"(4.2 nfs)"/ \
66259243Sobrien			n@*@'`grep -v "^#" /etc/fstab | tr -s " " "	" | cut -f 2`'@
66359243Sobrien    complete umount	c/-/"(a h t v)"/ n/-t/"(4.2 nfs)"/ \
66459243Sobrien			n/-h/'`df | cut -s -d ":" -f 1 | sort -u`'/ \
66559243Sobrien			n/*/'`mount | cut -d " " -f 3`'/
66659243Sobrien    # BSD 4.2 filesystems
66759243Sobrien    #complete  mount	c/-/"(a r t v)"/ n/-t/"(ufs nfs)"/ \
66859243Sobrien    #			n@*@'`cut -d ":" -f 2 /etc/fstab`'@
66959243Sobrien    #complete umount	c/-/"(a h t v)"/ n/-t/"(ufs nfs)"/ \
67059243Sobrien    #			n/-h/'`df | cut -s -d ":" -f 1 | sort -u`'/ \
67159243Sobrien    #			n/*/'`mount | cut -d " " -f 3`'/
67259243Sobrien
67359243Sobrien    # these deal with NIS (formerly YP); if it's not running you don't need 'em
67459243Sobrien    complete domainname	p@1@D:$_ypdir@" " n@*@n@
67559243Sobrien    complete ypcat	c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
67659243Sobrien	    N@-d@\`\\ls\ -1\ $_ypdir/\$:-1\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
67759243Sobrien	  n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
67859243Sobrien    complete ypmatch	c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
67959243Sobrien	            N@-d@x:'<key ...>'@ n@-@x:'<key ...>'@ p@1@x:'<key ...>'@ \
68059243Sobrien	  n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
68159243Sobrien    complete ypwhich	c@-@"(d m t x V1 V2)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
68259243Sobrien	 n@-m@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
68359243Sobrien			N@-m@n@ n@*@\$hosts@
68459243Sobrien
68559243Sobrien    # there's no need to clutter the user's shell with these
68659243Sobrien    unset _elispdir _maildir _ypdir _domain
68759243Sobrien
68859243Sobrien    complete make \
68959243Sobrien	'n/-f/f/' \
69059243Sobrien      	'c/*=/f/' \
69159243Sobrien	'n@*@`cat -s GNUmakefile Makefile makefile |& sed -n -e "/No such file/d" -e "/^[^     #].*:/s/:.*//p"`@'
69259243Sobrien
69359243Sobrien    if ( -f /etc/printcap ) then
69459243Sobrien	set printers=(`sed -n -e "/^[^     #].*:/s/:.*//p" /etc/printcap`)
69559243Sobrien
69659243Sobrien	complete lpr    'c/-P/$printers/'
69759243Sobrien	complete lpq    'c/-P/$printers/'
69859243Sobrien	complete lprm   'c/-P/$printers/'
69959243Sobrien	complete lpquota        'p/1/(-Qprlogger)/' 'c/-P/$printers/'
70059243Sobrien	complete dvips  'c/-P/$printers/' 'n/-o/f:*.{ps,PS}/' 'n/*/f:*.dvi/'
70159243Sobrien    endif
70259243Sobrien
70359243Sobrien    unset noglob
70459243Sobrien    unset complete
70559243Sobrienendif
70659243Sobrien
70759243Sobrienend:
70859243Sobrien	onintr
709