159243Sobrien#
259243Sobrien# example file using the new completion code
359243Sobrien#
4131962Smp# Debian GNU/Linux
5131962Smp# /usr/share/doc/tcsh/examples/complete.gz
6131962Smp#
7145479Smp# This file may be read from user's ~/.cshrc or ~/.tcshrc file by
8131962Smp# decompressing it into the home directory as ~/.complete and
9131962Smp# then adding the line "source ~/.complete" and maybe defining
10131962Smp# some of the shell variables described below.
11131962Smp#
12131962Smp# Added two Debian-specific completions: dpkg and dpkg-deb (who
13131962Smp# wrote them?). Changed completions of several commands. The ones
14131962Smp# are evaluated if the `traditional_complete' shell variable is
15131962Smp# defined.
16131962Smp#
17131962Smp# Debian enhancements by Vadim Vygonets <vadik@cs.huji.ac.il>.
18131962Smp# Bugfixes and apt completions by Miklos Quartus <miklos.quartus@nokia.com>.
19131962Smp# Cleanup by Martin A. Godisch <martin@godisch.de>.
2059243Sobrien
2159243Sobrienonintr -
22316957Sdchaginif ( ! $?prompt ) goto end
2359243Sobrien
24316957Sdchaginif ( $?tcsh ) then
25316957Sdchagin  if ( $tcsh != 1 ) then
26316957Sdchagin    set rev=$tcsh:r:r
27316957Sdchagin    set rel=$tcsh:r:e
28316957Sdchagin    if ( $rev > 6 || ( $rev > 5 && $rel > 1 ) ) then
29316957Sdchagin      set _has_complete=1
3059243Sobrien    endif
31316957Sdchagin  endif
32316957Sdchagin  unset rev rel
3359243Sobrienendif
3459243Sobrien
35316957Sdchaginif ( ! $?_has_complete ) goto end
3659243Sobrien
37316957Sdchaginif ( ! $?noglob ) set noglob _unset_noglob
3859243Sobrien
39316957Sdchagin# Old TCSH versions don't define OSTYPE.
40316957Sdchagin# Use a close approximation instead.
4159243Sobrien
42316957Sdchaginif ( ! $?OSTYPE ) then
43316957Sdchagin  setenv OSTYPE `echo "$HOSTTYPE" | sed -e 's/^(i[3456]86|(amd|x86_)64)-//'`
44316957Sdchaginendif
4559243Sobrien
46316957Sdchaginif ( ! $?hosts ) set hosts
4759243Sobrien
48316957Sdchaginforeach f ( "$HOME/."{,r,ssh/known_}hosts* \
49316957Sdchagin  /usr/local/etc/csh.hosts /etc/hosts.equiv )
50316957Sdchagin  if ( -r "$f" ) then
51316957Sdchagin    set hosts=($hosts `sed \
52316957Sdchagin      -e 's/#.*//' \
53316957Sdchagin      -e '/^[+-]@/d' \
54316957Sdchagin      -e 's/^[-+]//' \
55316957Sdchagin      -e 's/[[:space:]].*//' \
56316957Sdchagin      -e 's/,/\n/g' "$f" \
57316957Sdchagin      | sed -e '/^[.:[:xdigit:][:space:]]*$/d'`)
58316957Sdchagin  endif
59316957Sdchaginend
60316957Sdchaginunset f
6159243Sobrien
62316957Sdchaginif ( -r "$HOME/.netrc" ) then
63316957Sdchagin  set hosts=($hosts `awk '$1 == "machine" { print $2 }' "$HOME/.netrc"`)
64316957Sdchaginendif
6559243Sobrien
66316957Sdchaginset hosts=(`echo $hosts | tr ' ' '\012' | sort -u`)
6759243Sobrien
68316957Sdchaginif ( ! $#hosts ) then
69316957Sdchagin  # This is just a hint for the user.
70316957Sdchagin  set hosts=(ftp.funet.fi ftp.gnu.org ftp.uu.net)
71316957Sdchaginendif
7259243Sobrien
73316957Sdchagincomplete ywho		n/*/\$hosts/	# argument from list in $hosts
74316957Sdchagincomplete rsh		p/1/\$hosts/ c/-/"(l n)"/   n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
75316957Sdchagincomplete ssh		p/1/\$hosts/ c/-/"(l n)"/   n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
76316957Sdchagincomplete xrsh		p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
77316957Sdchagincomplete rlogin 	p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/
78316957Sdchagincomplete telnet 	p/1/\$hosts/ p/2/x:'<port>'/ n/*/n/
7959243Sobrien
80316957Sdchagincomplete cd  		p/1/d/		# Directories only
81316957Sdchagincomplete chdir 		p/1/d/
82316957Sdchagincomplete pushd 		p/1/d/
83316957Sdchagincomplete popd 		p/1/d/
84316957Sdchagincomplete pu 		p/1/d/
85316957Sdchagincomplete po 		p/1/d/
86316957Sdchagincomplete complete 	p/1/X/		# Completions only
87316957Sdchagincomplete uncomplete	n/*/X/
88316957Sdchagincomplete exec 		p/1/c/		# Commands only
89316957Sdchagincomplete trace 		p/1/c/
90316957Sdchagincomplete strace 	p/1/c/
91316957Sdchagincomplete which		n/*/c/
92316957Sdchagincomplete where		n/*/c/
93316957Sdchagincomplete skill 		p/1/c/
94316957Sdchagincomplete dde		p/1/c/ 
95316957Sdchagincomplete adb		c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
96316957Sdchagincomplete sdb		p/1/c/
97316957Sdchagincomplete dbx		c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
98316957Sdchagincomplete xdb		p/1/c/
99316957Sdchagincomplete gdb		n/-d/d/ n/*/c/
100316957Sdchagincomplete ups		p/1/c/
101316957Sdchagincomplete set		'c/*=/f/' 'p/1/s/=' 'n/=/f/'
102316957Sdchagincomplete unset		n/*/s/
103316957Sdchagincomplete alias 		p/1/a/		# only aliases are valid
104316957Sdchagincomplete unalias	n/*/a/
105316957Sdchagincomplete xdvi 		n/*/f:*.dvi/
106316957Sdchagincomplete dvips 		n/*/f:*.dvi/
107316957Sdchagincomplete tex	 	n/*/f:*.{tex,texi}/
108316957Sdchagincomplete latex	 	n/*/f:*.{tex,ltx}/
10959243Sobrien
110316957Sdchagincomplete su \
111316957Sdchagin  c/--/"(login fast preserve-environment command shell help version)"/ \
112316957Sdchagin  c/-/"(f l m p c s -)"/ \
113316957Sdchagin  n/{-c,--command}/c/ \
114316957Sdchagin  n@{-s,--shell}@'`cat /etc/shells`'@ \
115316957Sdchagin  n/*/u/
116316957Sdchagincomplete cc \
117316957Sdchagin  c/-[IL]/d/ \
118316957Sdchagin  c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
119316957Sdchagin  c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
120316957Sdchagincomplete acc \
121316957Sdchagin  c/-[IL]/d/ \
122316957Sdchagin  c@-l@'`\ls -1 /usr/lang/SC1.0/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
123316957Sdchagin  c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
124316957Sdchagincomplete gcc \
125316957Sdchagin  c/-[IL]/d/ \
126316957Sdchagin  c/-f/"(caller-saves cse-follow-jumps delayed-branch elide-constructors \
127316957Sdchagin	expensive-optimizations float-store force-addr force-mem inline \
128316957Sdchagin	inline-functions keep-inline-functions memoize-lookups \
129316957Sdchagin	no-default-inline no-defer-pop no-function-cse omit-frame-pointer \
130316957Sdchagin	rerun-cse-after-loop schedule-insns schedule-insns2 strength-reduce \
131316957Sdchagin	thread-jumps unroll-all-loops unroll-loops syntax-only all-virtual \
132316957Sdchagin	cond-mismatch dollars-in-identifiers enum-int-equiv no-asm no-builtin \
133316957Sdchagin	no-strict-prototype signed-bitfields signed-char this-is-variable \
134316957Sdchagin	unsigned-bitfields unsigned-char writable-strings call-saved-reg \
135316957Sdchagin	call-used-reg fixed-reg no-common no-gnu-binutils nonnull-objects \
136316957Sdchagin	pcc-struct-return pic PIC shared-data short-enums short-double \
137316957Sdchagin	volatile)"/ \
138316957Sdchagin  c/-W/"(all aggregate-return cast-align cast-qual comment conversion \
139316957Sdchagin	enum-clash error format id-clash-len implicit missing-prototypes \
140316957Sdchagin	no-parentheses pointer-arith return-type shadow strict-prototypes \
141316957Sdchagin	switch uninitialized unused write-strings)"/ \
142316957Sdchagin  c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd short c68000 c68020 \
143316957Sdchagin	soft-float g gnu unix fpu no-epilogue)"/ \
144316957Sdchagin  c/-d/"(D M N)"/ \
145316957Sdchagin  c/-/"(f W vspec v vpath ansi traditional traditional-cpp trigraphs pedantic \
146316957Sdchagin	x o l c g L I D U O O2 C E H B b V M MD MM i dynamic nodtdlib static \
147316957Sdchagin	nostdinc undef)"/ \
148316957Sdchagin  c/-l/f:*.a/ \
149316957Sdchagin  n/*/f:*.{c,C,cc,o,a,s,i}/
150316957Sdchagincomplete g++ 	n/*/f:*.{C,cc,o,s,i}/
151316957Sdchagincomplete CC 	n/*/f:*.{C,cc,cpp,o,s,i}/
152316957Sdchagincomplete rm \
153316957Sdchagin  c/--/"(directory force interactive verbose recursive help version)"/ \
154316957Sdchagin  c/-/"(d f i v r R -)"/ \
155316957Sdchagin  n/*/f:^*.{c,cc,C,h,in}/
156316957Sdchagin  # Protect precious files
157316957Sdchagincomplete vi 	n/*/f:^*.[oa]/
158316957Sdchagincomplete bindkey \
159316957Sdchagin  N/-a/b/ N/-c/c/ n/-[ascr]/'x:<key-sequence>'/ \
160316957Sdchagin  n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/ \
161316957Sdchagin  n/-k/"(left right up down)"/ p/2-/b/ \
162316957Sdchagin  p/1/'x:<key-sequence or option>'/
16359243Sobrien
164316957Sdchagincomplete find \
165316957Sdchagin  n/-fstype/"(nfs 4.2)"/ \
166316957Sdchagin  n/-name/f/ \
167316957Sdchagin  n/-type/"(c b d f p l s)"/ \
168316957Sdchagin  n/-user/u/ \
169316957Sdchagin  n/-group/g/ \
170316957Sdchagin  n/-exec/c/ \
171316957Sdchagin  n/-ok/c/ \
172316957Sdchagin  n/-cpio/f/ \
173316957Sdchagin  n/-ncpio/f/ \
174316957Sdchagin  n/-newer/f/ \
175316957Sdchagin  c/-/"(fstype name perm prune type user nouser group nogroup size inum \
176316957Sdchagin	atime mtime ctime exec ok print ls cpio ncpio newer xdev depth \
177316957Sdchagin	daystart follow maxdepth mindepth noleaf version anewer cnewer \
178316957Sdchagin	amin cmin mmin true false uid gid ilname iname ipath iregex links \
179316957Sdchagin	lname empty path regex used xtype fprint fprint0 fprintf print0 \
180316957Sdchagin	printf not a and o or)"/ \
181316957Sdchagin  n/*/d/
18259243Sobrien
183316957Sdchagincomplete -%*		c/%/j/			# fill in the jobs builtin
184316957Sdchagincomplete {fg,bg,stop}	c/%/j/ p/1/"(%)"//
18559243Sobrien
186316957Sdchagincomplete limit		c/-/"(h)"/ n/*/l/
187316957Sdchagincomplete unlimit	c/-/"(h)"/ n/*/l/
18859243Sobrien
189316957Sdchagin#complete -co*	p/0/"(compress)"/	# make compress completion
190316957Sdchagin#					    # not ambiguous
19159243Sobrien
192316957Sdchagin# "zcat" may be linked to "compress" or "gzip"
193316957Sdchaginif (-X zcat) then
194316957Sdchagin  zcat --version >& /dev/null
195316957Sdchagin  if ($status != 0) then
196316957Sdchagin    complete zcat	n/*/f:*.Z/
197316957Sdchagin  else
198316957Sdchagin    complete zcat	c/--/"(force help license quiet version)"/ \
199316957Sdchagin			c/-/"(f h L q V -)"/ \
200316957Sdchagin			n/*/f:*.{gz,Z,z,zip}/
201316957Sdchagin  endif
202316957Sdchaginendif
20359243Sobrien
204316957Sdchagincomplete finger	c/*@/\$hosts/ n/*/u/@ 
205316957Sdchagincomplete ping	p/1/\$hosts/
206316957Sdchagincomplete traceroute	p/1/\$hosts/
20759243Sobrien
208316957Sdchagincomplete {talk,ntalk,phone} \
209316957Sdchagin  p/1/'`users | tr " " "\012" | uniq`'/ \
210316957Sdchagin  n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/
21159243Sobrien
212316957Sdchagincomplete ftp	c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/
21359243Sobrien
214316957Sdchagin# this one is simple...
215316957Sdchagin#complete rcp c/*:/f/ C@[./\$~]*@f@ n/*/\$hosts/:
216316957Sdchagin# From Michael Schroeder <mlschroe@immd4.informatik.uni-erlangen.de> 
217316957Sdchagin# This one will rsh to the file to fetch the list of files!
218316957Sdchagincomplete 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/:'
21959243Sobrien
220316957Sdchagincomplete dd \
221316957Sdchagin  c/--/"(help version)"/ c/[io]f=/f/ \
222316957Sdchagin  c/conv=*,/"(ascii ebcdic ibm block unblock \
223316957Sdchagin	      lcase notrunc ucase swab noerror sync)"/,\
224316957Sdchagin  c/conv=/"(ascii ebcdic ibm block unblock \
225316957Sdchagin	    lcase notrunc ucase swab noerror sync)"/,\
226316957Sdchagin  c/*=/x:'<number>'/ \
227316957Sdchagin  n/*/"(if of conv ibs obs bs cbs files skip file seek count)"/=
22859243Sobrien
229316957Sdchagincomplete nslookup   p/1/x:'<host>'/ p/2/\$hosts/
23059243Sobrien
231316957Sdchagincomplete ar \
232316957Sdchagin  c/[dmpqrtx]/"(c l o u v a b i)"/ \
233316957Sdchagin  p/1/"(d m p q r t x)"// \
234316957Sdchagin  p/2/f:*.a/ \
235316957Sdchagin  p/*/f:*.o/
23659243Sobrien
237316957Sdchagin# these should be merged with the MH completion hacks below - jgotts
238316957Sdchagincomplete {refile,sprev,snext,scan,pick,rmm,inc,folder,show} \
239316957Sdchagin	    "c@+@F:$HOME/Mail/@"
24059243Sobrien
241316957Sdchagin# these and interrupt handling from Jaap Vermeulen <jaap@sequent.com>
242316957Sdchagincomplete {rexec,rxexec,rxterm,rmterm} \
243316957Sdchagin  'p/1/$hosts/' \
244316957Sdchagin  'c/-/(l L E)/' \
245316957Sdchagin  'n/-l/u/' \
246316957Sdchagin  'n/-L/f/' \
247316957Sdchagin  'n/-E/e/' \
248316957Sdchagin  'n/*/c/'
249316957Sdchagincomplete kill \
250316957Sdchagin  'c/-/S/' \
251316957Sdchagin  'c/%/j/' \
252316957Sdchagin  'n/*/`ps -u $LOGNAME | awk '"'"'{print $1}'"'"'`/'
25359243Sobrien
254316957Sdchagin# these from Marc Horowitz <marc@cam.ov.com>
255316957Sdchagincomplete attach \
256316957Sdchagin  'n/-mountpoint/d/' \
257316957Sdchagin  'n/-m/d/' \
258316957Sdchagin  'n/-type/(afs nfs rvd ufs)/' \
259316957Sdchagin  'n/-t/(afs nfs rvd ufs)/' \
260316957Sdchagin  'n/-user/u/' \
261316957Sdchagin  'n/-U/u/' \
262316957Sdchagin  'c/-/(verbose quiet force printpath lookup debug map nomap remap zephyr \
263316957Sdchagin	nozephyr readonly write mountpoint noexplicit explicit type \
264316957Sdchagin	mountoptions nosetuid setuid override skipfsck lock user host)/' \
265316957Sdchagin  'n/-e/f/' \
266316957Sdchagin  'n/*/()/'
267316957Sdchagincomplete hesinfo \
268316957Sdchagin  'p/1/u/' \
269316957Sdchagin  'p/2/(passwd group uid grplist pcap pobox cluster filsys sloc service)/'
27059243Sobrien
271316957Sdchagincomplete ./configure \
272316957Sdchagin  'c@--{prefix,exec-prefix,bindir,sbindir,libexecdir,datadir,sysconfdir,sharedstatedir,localstatedir,infodir,mandir,srcdir,x-includes,x-libraries}=*@x:<directory e.g. /usr/local>'@ \
273316957Sdchagin  'c/--cachefile=*/x:<filename>/' \
274316957Sdchagin  'c/--{enable,disable,with}-*/x:<feature>//' \
275316957Sdchagin  'c/--*=/x:<directory>//' \
276316957Sdchagin  'c/--/(prefix= exec-prefix= bindir= sbindir= libexecdir= datadir= \
277316957Sdchagin	sysconfdir= sharedstatedir= localstatedir= infodir= mandir= \
278316957Sdchagin	srcdir= x-includes= x-libraries= cachefile= enable- disable- \
279316957Sdchagin	with- help no-create quiet silent version verbose )//'
28059243Sobrien
281316957Sdchagincomplete gs \
282316957Sdchagin  'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc dfaxhigh dfaxlow \
283316957Sdchagin		laserjet ljet4 sparc pbm pbmraw pgm pgmraw ppm ppmraw bit)/' \
284316957Sdchagin  'c/-sOutputFile=/f/' 'c/-s/(DEVICE OutputFile)/=' \
285316957Sdchagin  'c/-d/(NODISPLAY NOPLATFONTS NOPAUSE)/' 'n/*/f/'
286316957Sdchagincomplete perl		'n/-S/c/'
287316957Sdchagincomplete sccs \
288316957Sdchagin  p/1/"(admin cdc check clean comb deledit delget delta diffs edit enter \
289316957Sdchagin	fix get help info print prs prt rmdel sccsdiff tell unedit unget \
290316957Sdchagin	val what)"/
29159243Sobrien
292316957Sdchagincomplete printenv	'n/*/e/'
293316957Sdchagincomplete setenv		'p/1/e/' 'c/*:/f/'
29459243Sobrien
295316957Sdchagin# these and method of setting hosts from Kimmo Suominen <kim@tac.nyc.ny.us>
296316957Sdchaginif ( -f "$HOME/.mh_profile" && -X folders ) then 
297316957Sdchagin  if ( ! $?FOLDERS ) setenv FOLDERS "`folders -fast -recurse`"
298316957Sdchagin  if ( ! $?MHA )     setenv MHA     "`ali | sed -e '/^ /d' -e 's/:.*//'`"
29959243Sobrien
300316957Sdchagin  set folders = ( $FOLDERS )
301316957Sdchagin  set mha = ( $MHA )
30259243Sobrien
303316957Sdchagin  complete ali \
304316957Sdchagin    'c/-/(alias nolist list nonormalize normalize nouser user help)/' \
305316957Sdchagin    'n,-alias,f,'
30659243Sobrien
307316957Sdchagin  complete anno \
308316957Sdchagin    'c/-/(component noinplace inplace nodate date text help)/' \
309316957Sdchagin    'c,+,$folders,'  \
310316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
31159243Sobrien
312316957Sdchagin  complete burst \
313316957Sdchagin    'c/-/(noinplace inplace noquiet quiet noverbose verbose help)/' \
314316957Sdchagin    'c,+,$folders,'  \
315316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
31659243Sobrien
317316957Sdchagin  complete comp \
318316957Sdchagin    'c/-/(draftfolder draftmessage nodraftfolder editor noedit file form nouse use whatnowproc nowhatnowproc help)/' \
319316957Sdchagin    'c,+,$folders,'  \
320316957Sdchagin    'n,-whatnowproc,c,'  \
321316957Sdchagin    'n,-file,f,'\
322316957Sdchagin    'n,-form,f,'\
323316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
32459243Sobrien
325316957Sdchagin  complete dist \
326316957Sdchagin    'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit form noinplace inplace whatnowproc nowhatnowproc help)/' \
327316957Sdchagin    'c,+,$folders,'  \
328316957Sdchagin    'n,-whatnowproc,c,'  \
329316957Sdchagin    'n,-form,f,'\
330316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
33159243Sobrien
332316957Sdchagin  complete folder \
333316957Sdchagin    'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
334316957Sdchagin    'c,+,$folders,'  \
335316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
33659243Sobrien
337316957Sdchagin  complete folders \
338316957Sdchagin    'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
339316957Sdchagin    'c,+,$folders,'  \
340316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
34159243Sobrien
342316957Sdchagin  complete forw \
343316957Sdchagin    'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit filter form noformat format noinplace inplace digest issue volume whatnowproc nowhatnowproc help)/' \
344316957Sdchagin    'c,+,$folders,'  \
345316957Sdchagin    'n,-whatnowproc,c,'  \
346316957Sdchagin    'n,-filter,f,'\
347316957Sdchagin    'n,-form,f,'\
348316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
34959243Sobrien
350316957Sdchagin  complete inc \
351316957Sdchagin    'c/-/(audit file noaudit nochangecur changecur file form format nosilent silent notruncate truncate width help)/' \
352316957Sdchagin    'c,+,$folders,'  \
353316957Sdchagin    'n,-audit,f,'\
354316957Sdchagin    'n,-form,f,'
35559243Sobrien
356316957Sdchagin  complete mark \
357316957Sdchagin    'c/-/(add delete list sequence nopublic public nozero zero help)/' \
358316957Sdchagin    'c,+,$folders,'  \
359316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
36059243Sobrien
361316957Sdchagin  complete mhmail \
362316957Sdchagin    'c/-/(body cc from subject help)/' \
363316957Sdchagin    'n,-cc,$mha,'  \
364316957Sdchagin    'n,-from,$mha,'  \
365316957Sdchagin    'n/*/$mha/'
36659243Sobrien
367316957Sdchagin  complete mhpath \
368316957Sdchagin    'c/-/(help)/' \
369316957Sdchagin    'c,+,$folders,'  \
370316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
37159243Sobrien
372316957Sdchagin  complete msgchk \
373316957Sdchagin    'c/-/(nodate date nonotify notify help)/' 
37459243Sobrien
375316957Sdchagin  complete msh \
376316957Sdchagin    'c/-/(prompt noscan scan notopcur topcur help)/' 
37759243Sobrien
378316957Sdchagin  complete next \
379316957Sdchagin    'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
380316957Sdchagin    'c,+,$folders,'  \
381316957Sdchagin    'n,-moreproc,c,'  \
382316957Sdchagin    'n,-showproc,c,'  \
383316957Sdchagin    'n,-form,f,'
38459243Sobrien
385316957Sdchagin  complete packf \
386316957Sdchagin    'c/-/(file help)/' \
387316957Sdchagin    'c,+,$folders,'  \
388316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
38959243Sobrien
390316957Sdchagin  complete pick \
391316957Sdchagin    'c/-/(and or not lbrace rbrace cc date from search subject to othercomponent after before datefield sequence nopublic public nozero zero nolist list help)/' \
392316957Sdchagin    'c,+,$folders,'  \
393316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
39459243Sobrien
395316957Sdchagin  complete prev \
396316957Sdchagin    'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
397316957Sdchagin    'c,+,$folders,'  \
398316957Sdchagin    'n,-moreproc,c,'  \
399316957Sdchagin    'n,-showproc,c,'  \
400316957Sdchagin    'n,-form,f,'
40159243Sobrien
402316957Sdchagin  complete prompter \
403316957Sdchagin    'c/-/(erase kill noprepend prepend norapid rapid nodoteof doteof help)/' 
40459243Sobrien
405316957Sdchagin  complete refile \
406316957Sdchagin    'c/-/(draft nolink link nopreserve preserve src file help)/' \
407316957Sdchagin    'c,+,$folders,'  \
408316957Sdchagin    'n,-file,f,'\
409316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
41059243Sobrien
411316957Sdchagin  complete rmf \
412316957Sdchagin    'c/-/(nointeractive interactive help)/' \
413316957Sdchagin    'c,+,$folders,'  
41459243Sobrien
415316957Sdchagin  complete rmm \
416316957Sdchagin    'c/-/(help)/' \
417316957Sdchagin    'c,+,$folders,'  \
418316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
41959243Sobrien
420316957Sdchagin  complete scan \
421316957Sdchagin    'c/-/(noclear clear form format noheader header width noreverse reverse file help)/' \
422316957Sdchagin    'c,+,$folders,'  \
423316957Sdchagin    'n,-form,f,'\
424316957Sdchagin    'n,-file,f,'\
425316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
426316957Sdchagin
427316957Sdchagin  complete send \
428316957Sdchagin    'c/-/(alias draft draftfolder draftmessage nodraftfolder filter nofilter noformat format noforward forward nomsgid msgid nopush push noverbose verbose nowatch watch width help)/' \
429316957Sdchagin    'n,-alias,f,'\
430316957Sdchagin    'n,-filter,f,'
431316957Sdchagin
432316957Sdchagin  complete show \
433316957Sdchagin    'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
434316957Sdchagin    'c,+,$folders,'  \
435316957Sdchagin    'n,-moreproc,c,'  \
436316957Sdchagin    'n,-showproc,c,'  \
437316957Sdchagin    'n,-form,f,'\
438316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
439316957Sdchagin
440316957Sdchagin  complete sortm \
441316957Sdchagin    'c/-/(datefield textfield notextfield limit nolimit noverbose verbose help)/' \
442316957Sdchagin    'c,+,$folders,'  \
443316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
444316957Sdchagin
445316957Sdchagin  complete vmh \
446316957Sdchagin    'c/-/(prompt vmhproc novmhproc help)/' \
447316957Sdchagin    'n,-vmhproc,c,'  
448316957Sdchagin
449316957Sdchagin  complete whatnow \
450316957Sdchagin    'c/-/(draftfolder draftmessage nodraftfolder editor noedit prompt help)/' 
451316957Sdchagin
452316957Sdchagin  complete whom \
453316957Sdchagin    'c/-/(alias nocheck check draft draftfolder draftmessage nodraftfolder help)/' \
454316957Sdchagin    'n,-alias,f,'
455316957Sdchagin
456316957Sdchagin  complete plum \
457316957Sdchagin    'c/-/()/' \
458316957Sdchagin    'c,+,$folders,'  \
459316957Sdchagin    'n,*,`(mark | sed "s/:.*//" ; echo next cur prev first last)|tr " " "\012" | sort -u`,'
460316957Sdchagin
461316957Sdchagin  complete mail \
462316957Sdchagin    'c/-/()/' \
463316957Sdchagin    'n/*/$mha/'
464316957Sdchagin
465316957Sdchaginendif
466316957Sdchagin
467316957Sdchagin#from Dan Nicolaescu <dann@ics.uci.edu>
468316957Sdchaginif ( $?MODULESHOME ) then
469316957Sdchagin  alias Compl_module \
470316957Sdchagin    'find ${MODULEPATH:as/:/ /} -name .version -o -name .modulea\* -prune \
471316957Sdchagin    -o -print | sed `echo "-e s@${MODULEPATH:as%:%/\*@@g -e s@%}/\*@@g"`'
472316957Sdchagin  complete module \
473316957Sdchagin    'p%1%(add load unload switch display avail use unuse update purge list \
474316957Sdchagin	  clear help initadd initrm initswitch initlist initclear)%' \
475316957Sdchagin    'n%{unl*,sw*,inits*}%`echo "$LOADEDMODULES:as/:/ /"`%' \
476316957Sdchagin    'n%{lo*,di*,he*,inita*,initr*}%`eval Compl_module`%' \
477316957Sdchagin    'N%{sw*,initsw*}%`eval Compl_module`%' \
478316957Sdchagin    'C%-%(-append)%' \
479316957Sdchagin    'n%{use,unu*,av*}%d%' \
480316957Sdchagin    'n%-append%d%' \
481316957Sdchagin    'C%[^-]*%`eval Compl_module`%'
482316957Sdchaginendif
483316957Sdchagin
484316957Sdchagin# from George Cox
485316957Sdchagincomplete acroread	'p/*/f:*.{pdf,PDF}/'
486316957Sdchagincomplete apachectl	'c/*/(start stop restart fullstatus status graceful \
487316957Sdchagin			      configtest help)/'
488316957Sdchagincomplete appletviewer	'p/*/f:*.class/'
489316957Sdchagincomplete bison		'c/--/(debug defines file-prefix= fixed-output-files \
490316957Sdchagin				help name-prefix= no-lines no-parser output= \
491316957Sdchagin				token-table verbose version yacc)/' \
492316957Sdchagin			'c/-/(b d h k l n o p t v y V)/' \
493316957Sdchagin			'n/-b/f/' 'n/-o/f/' 'n/-p/f/'
494316957Sdchagincomplete bzcat		c/--/"(help test quiet verbose license version)"/ \
495145479Smp			c/-/"(h t L V -)"/ n/*/f:*.{bz2,tbz}/
496316957Sdchagincomplete bunzip2	c/--/"(help keep force test stdout quiet verbose \
497316957Sdchagin				license version)"/ \
498316957Sdchagin			c/-/"(h k f t c q v L V -)"/ \
499145479Smp			n/*/f:*.{bz2,tbz}/
500316957Sdchagincomplete bzip2		c/--/"(help decompress compress keep force test \
501316957Sdchagin				stdout quiet verbose license version small)"/ \
502145479Smp			c/-/"(h d z k f t c q v L V s 1 2 3 4 5 6 7 8 9 -)"/ \
503145479Smp			n/{-d,--decompress}/f:*.{bz2,tbz}/ \
504145479Smp			N/{-d,--decompress}/f:*.{bz2,tbz}/ n/*/f:^*.{bz2,tbz}/
505316957Sdchagincomplete c++		'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
506316957Sdchagincomplete co		'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
507316957Sdchagincomplete crontab	'n/-u/u/'
508316957Sdchagincomplete camcontrol	'p/1/(cmd debug defects devlist eject inquiry \
509316957Sdchagin			      modepage negotiate periphlist rescan reset \
510316957Sdchagin			      start stop tags tur)/'
511316957Sdchagincomplete ctlinnd	'p/1/(addhist allow begin cancel changegroup \
512316957Sdchagin			      checkfile drop feedinfo flush flushlogs go \
513316957Sdchagin			      hangup logmode mode name newgroup param pause \
514316957Sdchagin			      readers refile reject reload renumber reserve \
515316957Sdchagin			      rmgroup send shutdown kill throttle trace \
516316957Sdchagin			      xabort xexec)/'
517316957Sdchagincomplete cvs		'c/--/(help help-commands help-synonyms)/' \
518316957Sdchagin			'p/1/(add admin annotate checkout commit diff edit \
519316957Sdchagin			      editors export history import init log login \
520316957Sdchagin			      logout rdiff release remove rtag status tag \
521316957Sdchagin			      unedit update watch watchers)/' \
522316957Sdchagin			'n/-a/(edit unedit commit all none)/' \
523316957Sdchagin			'n/watch/(on off add remove)/'
524316957Sdchagincomplete svn	 	'C@file:///@`'"${HOME}/etc/tcsh/complete.d/svn"'`@@' \
525195609Smp			'n@ls@(file:/// svn+ssh:// svn://)@@' \
526316957Sdchagin			'n@help@(add blame cat checkout cleanup commit copy \
527316957Sdchagin				  delete export help import info list ls \
528316957Sdchagin				  lock log merge mkdir move propdel propedit \
529316957Sdchagin				  propget proplist propset resolved revert \
530316957Sdchagin				  status switch unlock update)@' \
531316957Sdchagin			'p@1@(add blame cat checkout cleanup commit copy \
532316957Sdchagin			      delete export help import info list ls lock \
533316957Sdchagin			      log merge mkdir move propdel propedit propget \
534316957Sdchagin			      proplist propset resolved revert status switch \
535316957Sdchagin			      unlock update)@'
536316957Sdchagin
537316957Sdchagincomplete cxx		'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
538316957Sdchagincomplete detex		'p/*/f:*.tex/'
539316957Sdchagincomplete edquota	'n/*/u/'
540316957Sdchagincomplete exec		'p/1/c/'
541316957Sdchagincomplete ghostview	'p/*/f:*.ps/'
542316957Sdchagincomplete gv		'p/*/f:*.ps/'
543316957Sdchagincomplete ifconfig	'p@1@`ifconfig -l`@' \
544316957Sdchagin			'n/*/(range phase link netmask mtu vlandev vlan \
545316957Sdchagin			    metric mediaopt down delete broadcast arp debug)/'
546316957Sdchagincomplete imake		'c/-I/d/'
547316957Sdchagincomplete ipfw		'p/1/(flush add delete list show zero)/' \
54869408Sache			'n/add/(allow permit accept pass deny drop reject \
549316957Sdchagin				reset count skipto num divert port tee port)/'
550316957Sdchagincomplete javac		'p/*/f:*.java/'
551316957Sdchagincomplete ldif2ldbm	'n/-i/f:*.ldif/'
552316957Sdchagincomplete libtool	'c/--mode=/(compile execute finish install link \
553316957Sdchagin				    uninstall)/' \
554316957Sdchagin			'c/--/(config debug dry-run features finish help \
555316957Sdchagin				quiet silent version mode=)/'
556316957Sdchagincomplete libtoolize	'c/--/(automake copy debug dry-run force help ltdl \
557316957Sdchagin				ltdl-tar version)/'
558316957Sdchagincomplete links		'c/-/(assume-codepage async-dns download-dir \
559316957Sdchagin			      format-cache-size ftp-proxy help http-proxy \
560316957Sdchagin			      max-connections max-connections-to-host \
561316957Sdchagin			      memory-cache-size receive-timeout retries \
562316957Sdchagin			      unrestartable-receive-timeout version)/'
563316957Sdchagincomplete natd		c/-/'(alias_address config deny_incoming dynamic \
564316957Sdchagin			      inport interface log log_denied log_facility \
565316957Sdchagin			      outport outport port pptpalias proxy_only \
566316957Sdchagin			      proxy_rule redirect_address redirect_port \
567316957Sdchagin			      reverse same_ports unregistered_only use_sockets \
568316957Sdchagin			      verbose)'/ \
569316957Sdchagin			'n@-interface@`ifconfig -l`@'
570316957Sdchagincomplete netstat	'n@-I@`ifconfig -l`@'
571316957Sdchagincomplete objdump	'c/--/(adjust-vma= all-headers architecture= \
572316957Sdchagin			      archive-headers debugging demangle disassemble \
573316957Sdchagin			      disassemble-all disassemble-zeroes dynamic-reloc \
574316957Sdchagin			      dynamic-syms endian= file-headers full-contents \
575316957Sdchagin			      headers help info line-numbers no-show-raw-insn \
576316957Sdchagin			      prefix-addresses private-headers reloc \
577316957Sdchagin			      section-headers section=source stabs \
578316957Sdchagin			      start-address= stop-address= syms target= \
579316957Sdchagin			      version wide)/' \
58069408Sache			'c/-/(a h i f C d D p r R t T x s S l w)/'
581316957Sdchagincomplete xmodmap	'c/-/(display help grammar verbose quiet n e pm pk \
582316957Sdchagin			      pke pp)/'
583316957Sdchagincomplete lynx		'c/-/(accept_all_cookies anonymous assume_charset= \
584316957Sdchagin			      assume_local_charset= assume_unrec_charset= \
585316957Sdchagin			      auth= base book buried_news cache= case cfg= \
586316957Sdchagin			      child cookie_file= cookies core crawl \
587316957Sdchagin			      debug_partial display= dump editor= emacskeys \
588316957Sdchagin			      enable_scrollback error_file= force_html \
589316957Sdchagin			      force_secure forms_options from ftp get_data \
590316957Sdchagin			      head help hiddenlinks= historical homepage= \
591316957Sdchagin			      image_links index= ismap link= localhost \
592316957Sdchagin			      mime_header minimal newschunksize= \
593316957Sdchagin			      newsmaxchunk= nobrowse nocc nocolor \
594316957Sdchagin			      nofilereferer nolist nolog nopause noprint \
595316957Sdchagin			      noredir noreferer nostatus number_links \
596316957Sdchagin			      partial partial_thres pauth= popup post_data \
597316957Sdchagin			      preparsed print pseudo_inlines raw realm \
598316957Sdchagin			      reload restrictions= resubmit_posts rlogin \
599316957Sdchagin			      selective show_cursor soft_dquotes source \
600316957Sdchagin			      stack_dump startfile_ok tagsoup telnet term= \
601316957Sdchagin			      tlog trace traversal underscore useragent= \
602316957Sdchagin			      validate verbose version vikeys width=)/' \
603316957Sdchagin			'c/(http|ftp)/$URLS/'
604316957Sdchagincomplete gmake		'c/{--directory=,--include-dir=}/d/' \
60569408Sache			'c/{--assume-new,--assume-old,--makefile,--new-file,--what-if,--file}/f/' \
60669408Sache			'c/--/(assume-new= assume-old= debug directory= \
607316957Sdchagin			      dry-run environment-overrides file= help \
608316957Sdchagin			      ignore-errors include-dir= jobs[=N] just-print \
609316957Sdchagin			      keep-going load-average[=N] makefile= \
610316957Sdchagin			      max-load[=N] new-file= no-builtin-rules \
611316957Sdchagin			      no-keep-going no-print-directory old-file= \
612316957Sdchagin			      print-data-base print-directory question quiet \
613316957Sdchagin			      recon silent stop touch version \
614316957Sdchagin			      warn-undefined-variables what-if=)/' \
61569408Sache			'n@*@`cat -s GNUMakefile Makefile makefile |& sed -n -e "/No such file/d" -e "s/^\([A-Za-z0-9-]*\):.*/\1/p"`@' \
616316957Sdchagin			'n/=/f/' \
617316957Sdchagin			'n/-f/f/'
618316957Sdchagincomplete mixer		p/1/'(vol bass treble synth pcm speaker mic cd mix \
619316957Sdchagin			      pcm2 rec igain ogain line1 line2 line3)'/ \
62069408Sache			p@2@'`mixer $:-1 | awk \{\ print\ \$7\ \}`'@
62169408Sache
622316957Sdchagincomplete mpg123		'c/--/(2to1 4to1 8bit aggressive au audiodevice auth \
623316957Sdchagin			      buffer cdr check doublespeed equalizer frames \
624316957Sdchagin			      gain halfspeed headphones left lineout list \
625316957Sdchagin			      mix mono proxy quiet random rate reopen resync \
626316957Sdchagin			      right scale shuffle single0 single1 skip \
627316957Sdchagin			      speaker stdout stereo test verbose wav)/'
628316957Sdchagincomplete mysqladmin	'n/*/(create drop extended-status flush-hosts \
629316957Sdchagin			      flush-logs flush-status flush-tables \
630316957Sdchagin			      flush-privileges kill password ping \
631316957Sdchagin			      processlist reload refresh shutdown status \
632316957Sdchagin			      variables version)/'
63369408Sache
634316957Sdchagincomplete mutt \
635316957Sdchagin  "c@-f=@F:${HOME}/Mail/@" \
636316957Sdchagin  n/-a/f/ \
637316957Sdchagin  n/-F/f/ \
638316957Sdchagin  n/-H/f/ \
639316957Sdchagin  n/-s/x:'<subject line>'/ \
640316957Sdchagin  n/-e/x:'<command>'/ \
641316957Sdchagin  n@-b@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@ \
642316957Sdchagin  n@-c@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@ \
643316957Sdchagin  n@*@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@
64459243Sobrien
645316957Sdchagincomplete ndc	'n/*/(status dumpdb reload stats trace notrace \
646316957Sdchagin		    querylog start stop restart )/'
64759243Sobrien
648316957Sdchagincomplete nm \
649316957Sdchagin  'c/--radix=/x:<radix: _o_ctal _d_ecimal he_x_adecimal>/' \
650316957Sdchagin  'c/--target=/x:<bfdname>/' \
651316957Sdchagin  'c/--format=/(bsd sysv posix)/n/' \
652316957Sdchagin  'c/--/(debugsyms extern-only demangle dynamic print-armap \
653316957Sdchagin	  print-file-name numeric-sort no-sort reverse-sort \
654316957Sdchagin	  size-sort undefined-only portability target= radix= \
655316957Sdchagin	  format= defined-only\ line-numbers no-demangle version \
656316957Sdchagin	  help)//' \
657316957Sdchagin  'n/*/f:^*.{h,c,cc,s,S}/'
65859243Sobrien
659316957Sdchagincomplete nmap	'n@-e@`ifconfig -l`@' 'p/*/$hostnames/'
660316957Sdchagincomplete perldoc 	'n@*@`\ls -1 /usr/libdata/perl/5.*/pod | sed s%\\.pod.\*\$%%`@'
661316957Sdchagincomplete postfix    'n/*/(start stop reload abort flush check)/'
662316957Sdchagincomplete postmap	'n/1/(hash: regexp:)/' 'c/hash:/f/' 'c/regexp:/f/'
663316957Sdchagincomplete rcsdiff	'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
664316957Sdchagincomplete X		'c/-/(I a ac allowMouseOpenFail allowNonLocalModInDev \
665316957Sdchagin		    allowNonLocalXvidtune ar1 ar2 audit auth bestRefresh \
666316957Sdchagin		    bgamma bpp broadcast bs c cc class co core deferglyphs \
667316957Sdchagin		    disableModInDev disableVidMode displayID dpi dpms f fc \
668316957Sdchagin		    flipPixels fn fp gamma ggamma help indirect kb keeptty \
669316957Sdchagin		    ld lf logo ls nolisten string noloadxkb nolock nopn \
670316957Sdchagin		    once p pn port probeonly query quiet r rgamma s \
671316957Sdchagin		    showconfig sp su t terminate to tst v verbose version \
672316957Sdchagin		    weight wm x xkbdb xkbmap)/'
673316957Sdchagincomplete users      'c/--/(help version)/' 'p/1/x:"<accounting_file>"/'
674316957Sdchagincomplete vidcontrol	'p/1/(132x25 132x30 132x43 132x50 132x60 40x25 80x25 \
675316957Sdchagin		    80x30 80x43 80x50 80x60 EGA_80x25 EGA_80x43 \
676316957Sdchagin		    VESA_132x25 VESA_132x30 VESA_132x43 VESA_132x50 \
677316957Sdchagin		    VESA_132x60 VESA_800x600 VGA_320x200 VGA_40x25 \
678316957Sdchagin		    VGA_80x25 VGA_80x30 VGA_80x50 VGA_80x60)/'
679316957Sdchagincomplete vim	'n/*/f:^*.[oa]/'
680316957Sdchagincomplete where	'n/*/c/'
681316957Sdchagincomplete which	'n/*/c/'
682316957Sdchagincomplete wmsetbg	'c/-/(display D S a b c d e m p s t u w)/' \
683316957Sdchagin		    'c/--/(back-color center colors dither help match \
684316957Sdchagin		    maxscale parse scale smooth tile update-domain \
685316957Sdchagin		    update-wmaker version workspace)/'
686316957Sdchagincomplete xdb	'p/1/c/'
687316957Sdchagincomplete xdvi	'c/-/(allowshell debug display expert gamma hushchars \
688316957Sdchagin		    hushchecksums hushspecials install interpreter keep \
689316957Sdchagin		    margins nogrey noinstall nomakepk noscan paper safer \
690316957Sdchagin		    shrinkbuttonn thorough topmargin underlink version)/' \
691316957Sdchagin		    'n/-paper/(a4 a4r a5 a5r)/' 'p/*/f:*.dvi/'
692316957Sdchagincomplete xlock	'c/-/(allowaccess allowroot debug description \
693316957Sdchagin		    echokeys enablesaver grabmouse grabserver hide inroot \
694316957Sdchagin		    install inwindow mono mousemotion nolock remote \
695316957Sdchagin		    resetsaver sound timeelapsed use3d usefirst verbose \
696316957Sdchagin		    wireframe background batchcount bg bitmap both3d \
697316957Sdchagin		    count cycles delay delta3d display dpmsoff \
698316957Sdchagin		    dpmsstandby dpmssuspend endCmd erasedelay erasemode \
699316957Sdchagin		    erasetime fg font foreground geometry help \
700316957Sdchagin		    icongeometry info invalid left3d lockdelay logoutCmd \
701316957Sdchagin		    mailCmd mailIcon message messagefile messagefont \
702316957Sdchagin		    messagesfile mode name ncolors nice nomailIcon none3d \
703316957Sdchagin		    parent password planfont program resources right3d \
704316957Sdchagin		    saturation size startCmd timeout username validate \
705316957Sdchagin		    version visual)/' 'n/-mode/(ant atlantis ball bat \
706316957Sdchagin		    blot bouboule bounce braid bubble bubble3d bug cage \
707316957Sdchagin		    cartoon clock coral crystal daisy dclock decay deco \
708316957Sdchagin		    demon dilemma discrete drift eyes fadeplot flag flame \
709316957Sdchagin		    flow forest galaxy gears goop grav helix hop hyper \
710316957Sdchagin		    ico ifs image invert julia kaleid kumppa lament laser \
711316957Sdchagin		    life life1d life3d lightning lisa lissie loop lyapunov \
712316957Sdchagin		    mandelbrot marquee matrix maze moebius morph3d \
713316957Sdchagin		    mountain munch nose pacman penrose petal pipes puzzle \
714316957Sdchagin		    pyro qix roll rotor rubik shape sierpinski slip sphere \
715316957Sdchagin		    spiral spline sproingies stairs star starfish strange \
716316957Sdchagin		    superquadrics swarm swirl tetris thornbird triangle \
717316957Sdchagin		    tube turtle vines voters wator wire world worm xjack \
718316957Sdchagin		    blank bomb random)/' 
719316957Sdchagincomplete xfig	'c/-/(display)/' 'p/*/f:*.fig/'
720316957Sdchagincomplete wget 	c/--/"(accept= append-output= background cache= \
721316957Sdchagin		    continue convert-links cut-dirs= debug \
722316957Sdchagin		    delete-after directory-prefix= domains= \
723316957Sdchagin		    dont-remove-listing dot-style= exclude-directories= \
724316957Sdchagin		    exclude-domains= execute= follow-ftp \
725316957Sdchagin		    force-directories force-html glob= header= help \
726316957Sdchagin		    http-passwd= http-user= ignore-length \
727316957Sdchagin		    include-directories= input-file= level= mirror \
728316957Sdchagin		    no-clobber no-directories no-host-directories \
729316957Sdchagin		    no-host-lookup no-parent non-verbose \
730316957Sdchagin		    output-document= output-file= passive-ftp \
731316957Sdchagin		    proxy-passwd= proxy-user= proxy= quiet quota= \
732316957Sdchagin		    recursive reject= relative retr-symlinks save-headers \
733316957Sdchagin		    server-response span-hosts spider timeout= \
734316957Sdchagin		    timestamping tries= user-agent= verbose version wait=)"/
735316957Sdchagin
736316957Sdchagin# these from Tom Warzeka <tom@waz.cc>
737316957Sdchagin
738316957Sdchagin# this one works but is slow and doesn't descend into subdirectories
739316957Sdchagin# complete	cd	C@[./\$~]*@d@ \
740316957Sdchagin#			p@1@'`\ls -1F . $cdpath | grep /\$ | sort -u`'@ n@*@n@
741316957Sdchagin
742316957Sdchaginif ( -r /etc/shells ) then
743316957Sdchagin    complete setenv	p@1@e@ n@DISPLAY@\$hosts@: n@SHELL@'`cat /etc/shells`'@
744316957Sdchaginelse
745316957Sdchagin    complete setenv	p@1@e@ n@DISPLAY@\$hosts@:
746316957Sdchaginendif
747316957Sdchagincomplete unsetenv	n/*/e/
748316957Sdchagin
749316957Sdchaginset _maildir = /var/mail
750316957Sdchaginif (-r "$HOME/.mailrc") then
751316957Sdchagin    complete mail	c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
752316957Sdchagin		    "c@+@F:$HOME/Mail@" C@[./\$~]@f@ n/-s/x:'<subject>'/ \
753316957Sdchagin		    n@-u@T:$_maildir@ n/-f/f/ \
754316957Sdchagin		    n@*@'`sed -n s/alias//p "$HOME/.mailrc" | \
755316957Sdchagin		    tr -s " " "	" | cut -f 2`'@
756316957Sdchaginelse
757316957Sdchagin    complete mail	c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
758316957Sdchagin		    "c@+@F:$HOME/Mail@" C@[./\$~]@f@ n/-s/x:'<subject>'/ \
759316957Sdchagin		    n@-u@T:$_maildir@ n/-f/f/ n/*/u/
760316957Sdchaginendif
761316957Sdchaginunset _maildir
762316957Sdchagin
763316957Sdchaginif (! $?MANPATH) then
764316957Sdchagin    if (-r /usr/share/man) then
765316957Sdchagin	setenv MANPATH /usr/share/man:
76659243Sobrien    else
767316957Sdchagin	setenv MANPATH /usr/man:
76859243Sobrien    endif
769316957Sdchaginendif
77059243Sobrien
771316957Sdchaginif ($?traditional_complete) then
772316957Sdchagin    # use of $MANPATH from Dan Nicolaescu <dann@ics.uci.edu>
773316957Sdchagin    # use of 'find' adapted from Lubomir Host <host8@kepler.fmph.uniba.sk>
774316957Sdchagin    complete man \
775316957Sdchagin	'n@1@`set q = "$MANPATH:as%:%/man1 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.1.\*\$%%`@'\
776316957Sdchagin	'n@2@`set q = "$MANPATH:as%:%/man2 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.2.\*\$%%`@'\
777316957Sdchagin	'n@3@`set q = "$MANPATH:as%:%/man3 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.3.\*\$%%`@'\
778316957Sdchagin	'n@4@`set q = "$MANPATH:as%:%/man4 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.4.\*\$%%`@'\
779316957Sdchagin	'n@5@`set q = "$MANPATH:as%:%/man5 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.5.\*\$%%`@'\
780316957Sdchagin	'n@6@`set q = "$MANPATH:as%:%/man6 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.6.\*\$%%`@'\
781316957Sdchagin	'n@7@`set q = "$MANPATH:as%:%/man7 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.7.\*\$%%`@'\
782316957Sdchagin	'n@8@`set q = "$MANPATH:as%:%/man8 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.8.\*\$%%`@'\
783316957Sdchagin	'n@9@`set q = "$MANPATH:as%:%/man9 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.9.\*\$%%`@'\
784316957Sdchagin	'n@0@`set q = "$MANPATH:as%:%/man0 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.0.\*\$%%`@'\
785316957Sdchagin	'n@n@`set q = "$MANPATH:as%:%/mann %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.n.\*\$%%`@'\
786316957Sdchagin	'n@o@`set q = "$MANPATH:as%:%/mano %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.o.\*\$%%`@'\
787316957Sdchagin	'n@l@`set q = "$MANPATH:as%:%/manl %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.l.\*\$%%`@'\
788316957Sdchagin	'n@p@`set q = "$MANPATH:as%:%/manp %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.p.\*\$%%`@'\
789316957Sdchagin	c@-@"(- f k M P s S t)"@ n@-f@c@ n@-k@x:'<keyword>'@ n@-[MP]@d@   \
790316957Sdchagin	'N@-[MP]@`\ls -1 $:-1/man? |& sed -n s%\\..\\+\$%%p`@'            \
791316957Sdchagin	'n@-[sS]@`\ls -1 $MANPATH:as%:% % |& sed -n s%^man%%p | sort -u`@'\
792316957Sdchagin	'n@*@`find $MANPATH:as%:% % \( -type f -o -type l \) -printf "%f " |& sed -e "s%find: .*: No such file or directory%%" -e "s%\([^\.]\+\)\.\([^ ]*\) %\1 %g"`@'
793316957Sdchagin	#n@*@c@ # old way -- commands only
794316957Sdchaginelse
795316957Sdchagin    complete man	    n@1@'`\ls -1 /usr/man/man1 | sed s%\\.1.\*\$%%`'@ \
796316957Sdchagin			n@2@'`\ls -1 /usr/man/man2 | sed s%\\.2.\*\$%%`'@ \
797316957Sdchagin			n@3@'`\ls -1 /usr/man/man3 | sed s%\\.3.\*\$%%`'@ \
798316957Sdchagin			n@4@'`\ls -1 /usr/man/man4 | sed s%\\.4.\*\$%%`'@ \
799316957Sdchagin			n@5@'`\ls -1 /usr/man/man5 | sed s%\\.5.\*\$%%`'@ \
800316957Sdchagin			n@6@'`\ls -1 /usr/man/man6 | sed s%\\.6.\*\$%%`'@ \
801316957Sdchagin			n@7@'`\ls -1 /usr/man/man7 | sed s%\\.7.\*\$%%`'@ \
802316957Sdchagin			n@8@'`\ls -1 /usr/man/man8 | sed s%\\.8.\*\$%%`'@ \
803316957Sdchaginn@9@'`[ -r /usr/man/man9 ] && \ls -1 /usr/man/man9 | sed s%\\.9.\*\$%%`'@ \
804316957Sdchaginn@0@'`[ -r /usr/man/man0 ] && \ls -1 /usr/man/man0 | sed s%\\.0.\*\$%%`'@ \
805316957Sdchaginn@new@'`[ -r /usr/man/mann ] && \ls -1 /usr/man/mann | sed s%\\.n.\*\$%%`'@ \
806316957Sdchaginn@old@'`[ -r /usr/man/mano ] && \ls -1 /usr/man/mano | sed s%\\.o.\*\$%%`'@ \
807131962Smpn@local@'`[ -r /usr/man/manl ] && \ls -1 /usr/man/manl | sed s%\\.l.\*\$%%`'@ \
808131962Smpn@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
809316957Sdchagin	    c/-/"(- f k P s t)"/ n/-f/c/ n/-k/x:'<keyword>'/ n/-P/d/ \
810316957Sdchagin	    N@-P@'`\ls -1 $:-1/man? | sed s%\\..\*\$%%`'@ n/*/c/
811316957Sdchaginendif
81259243Sobrien
813316957Sdchagincomplete ps	        c/-t/x:'<tty>'/ c/-/"(a c C e g k l S t u v w x)"/ \
814316957Sdchagin		    n/-k/x:'<kernel>'/ N/-k/x:'<core_file>'/ n/*/x:'<PID>'/
815316957Sdchagincomplete compress	c/-/"(c f v b)"/ n/-b/x:'<max_bits>'/ n/*/f:^*.Z/
816316957Sdchagincomplete uncompress	c/-/"(c f v)"/                        n/*/f:*.Z/
81759243Sobrien
818316957Sdchagincomplete uuencode	p/1/f/ p/2/x:'<decode_pathname>'/ n/*/n/
819316957Sdchagincomplete uudecode	c/-/"(f)"/ n/-f/f:*.{uu,UU}/ p/1/f:*.{uu,UU}/ n/*/n/
82069408Sache
821316957Sdchagincomplete xhost	c/[+-]/\$hosts/ n/*/\$hosts/
822316957Sdchagincomplete xpdf	c/-/"(z g remote raise quit cmap rgb papercolor       \
823316957Sdchagin			  eucjp t1lib freetype ps paperw paperh level1    \
824316957Sdchagin			  upw fullscreen cmd q v h help)"/                \
825316957Sdchagin		    n/-z/x:'<zoom (-5 .. +5) or "page" or "width">'/      \
826316957Sdchagin		    n/-g/x:'<geometry>'/ n/-remote/x:'<name>'/            \
827316957Sdchagin		    n/-rgb/x:'<number>'/ n/-papercolor/x:'<color>'/       \
828316957Sdchagin		    n/-{t1lib,freetype}/x:'<font_type>'/                  \
829316957Sdchagin		    n/-ps/x:'<PS_file>'/ n/-paperw/x:'<width>'/           \
830316957Sdchagin		    n/-paperh/x:'<height>'/ n/-upw/x:'<password>'/        \
831316957Sdchagin		    n/-/f:*.{pdf,PDF}/                                    \
832316957Sdchagin		    N/-{z,g,remote,rgb,papercolor,t1lib,freetype,ps,paperw,paperh,upw}/f:*.{pdf,PDF}/ \
833316957Sdchagin		    N/-/x:'<page>'/ p/1/f:*.{pdf,PDF}/ p/2/x:'<page>'/
83459243Sobrien
835316957Sdchagincomplete tcsh	c/-D*=/'x:<value>'/ c/-D/'x:<name>'/ \
836316957Sdchagin		    c/-/"(b c d D e f F i l m n q s t v V x X -version)"/ \
837316957Sdchagin		    n/-c/c/ n/{-l,--version}/n/ n/*/'f:*.{,t}csh'/
838131962Smp
839316957Sdchagincomplete rpm	c/--/"(query verify nodeps nofiles nomd5 noscripts    \
840316957Sdchagin		    nogpg nopgp install upgrade freshen erase allmatches  \
841316957Sdchagin		    notriggers repackage test rebuild recompile initdb    \
842316957Sdchagin		    rebuilddb addsign resign querytags showrc setperms    \
843316957Sdchagin		    setugids all file group package querybynumber qf      \
844316957Sdchagin		    triggeredby whatprovides whatrequires changelog       \
845316957Sdchagin		    configfiles docfiles dump filesbypkg info last list   \
846316957Sdchagin		    provides queryformat requires scripts state triggers  \
847316957Sdchagin		    triggerscripts allfiles badreloc excludepath checksig \
848316957Sdchagin		    excludedocs force hash ignoresize ignorearch ignoreos \
849316957Sdchagin		    includedocs justdb noorder oldpackage percent prefix  \
850316957Sdchagin		    relocate replace-files replacepkgs buildroot clean    \
851316957Sdchagin		    nobuild rmsource rmspec short-circuit sign target     \
852316957Sdchagin		    help version quiet rcfile pipe dbpath root specfile)"/\
853316957Sdchagin		    c/-/"(q V K i U F e ba bb bp bc bi bl bs ta tb tp tc  \
854316957Sdchagin		    ti tl ts a f g p c d l R s h ? v vv -)"/              \
855316957Sdchagin	    n/{-f,--file}/f/ n/{-g,--group}/g/ n/--pipe/c/ n/--dbpath/d/  \
856316957Sdchagin	    n/--querybynumber/x:'<number>'/ n/--triggeredby/x:'<package>'/\
857316957Sdchagin	    n/--what{provides,requires}/x:'<capability>'/ n/--root/d/     \
858316957Sdchagin	    n/--{qf,queryformat}/x:'<format>'/ n/--buildroot/d/           \
859316957Sdchagin	    n/--excludepath/x:'<oldpath>'/  n/--prefix/x:'<newpath>'/     \
860316957Sdchagin	    n/--relocate/x:'<oldpath=newpath>'/ n/--target/x:'<platform>'/\
861316957Sdchagin	    n/--rcfile/x:'<filelist>'/ n/--specfile/x:'<specfile>'/       \
862316957Sdchagin	    n/{-[iUFep],--{install,upgrade,freshen,erase,package}}/f:*.rpm/
863131962Smp
864316957Sdchagin# these conform to the latest GNU versions available at press time ...
865316957Sdchagin# updates by John Gotts <jgotts@engin.umich.edu>
866316957Sdchaginif (-X emacs) then
867316957Sdchagin  # TW note:  if your version of GNU Emacs supports the "--version" option,
868316957Sdchagin  #           uncomment this line and comment the next to automatically
869316957Sdchagin  #           detect the version, else set "_emacs_ver" to your version.
870316957Sdchagin  #set _emacs_ver=`emacs --version | sed -e 's%GNU Emacs %%' -e q | cut -d . -f1-2`
871316957Sdchagin  set _emacs_ver=21.3
872316957Sdchagin  set _emacs_dir=`which emacs | sed s%/bin/emacs%%` 
873316957Sdchagin  complete emacs	c/--/"(batch terminal display no-windows no-init-file \
874316957Sdchagin			   user debug-init unibyte multibyte version help \
875316957Sdchagin			   no-site-file funcall load eval insert kill)"/ \
876316957Sdchagin		    c/-/"(t d nw q u f l -)"/ c/+/x:'<line_number>'/ \
877316957Sdchagin		    n/{-t,--terminal}/x:'<terminal>'/ n/{-d,--display}/x:'<display>'/ \
878316957Sdchagin		    n/{-u,--user}/u/ n/{-f,--funcall}/x:'<lisp_function>'/ \
879316957Sdchagin		    n@{-l,--load}@F:$_emacs_dir/share/emacs/$_emacs_ver/lisp@ \
880316957Sdchagin		    n/--eval/x:'<expression>'/ n/--insert/f/ n/*/f:^*[\#~]/
881316957Sdchagin  unset _emacs_ver _emacs_dir
882316957Sdchaginendif
88359243Sobrien
884316957Sdchagincomplete gzcat	c/--/"(force help license quiet version)"/ \
885316957Sdchagin		    c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
886316957Sdchagincomplete gzip	c/--/"(stdout to-stdout decompress uncompress \
887316957Sdchagin		    force help list license no-name quiet recurse \
888316957Sdchagin		    suffix test verbose version fast best)"/ \
889316957Sdchagin		    c/-/"(c d f h l L n q r S t v V 1 2 3 4 5 6 7 8 9 -)"/\
890316957Sdchagin		    n/{-S,--suffix}/x:'<file_name_suffix>'/ \
891316957Sdchagin		    n/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
892316957Sdchagin		    N/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
893316957Sdchagin		    n/*/f:^*.{gz,Z,z,zip,taz,tgz}/
894316957Sdchagincomplete {gunzip,ungzip} c/--/"(stdout to-stdout force help list license \
895316957Sdchagin		    no-name quiet recurse suffix test verbose version)"/ \
896316957Sdchagin		    c/-/"(c f h l L n q r S t v V -)"/ \
897316957Sdchagin		    n/{-S,--suffix}/x:'<file_name_suffix>'/ \
898316957Sdchagin		    n/*/f:*.{gz,Z,z,zip,taz,tgz}/
899316957Sdchagincomplete zgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
900316957Sdchagin		    c/-/"(A b B c C e f h i l n s v V w x)"/ \
901316957Sdchagin		    p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
902316957Sdchagin		    n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
903316957Sdchagincomplete zegrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
904316957Sdchagin		    c/-/"(A b B c C e f h i l n s v V w x)"/ \
905316957Sdchagin		    p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
906316957Sdchagin		    n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
907316957Sdchagincomplete zfgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
908316957Sdchagin		    c/-/"(A b B c C e f h i l n s v V w x)"/ \
909316957Sdchagin		    p/1/x:'<fixed_string>'/ N/-*e/f/ \
910316957Sdchagin		    n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
911316957Sdchagincomplete znew	c/-/"(f t v 9 P K)"/ n/*/f:*.Z/
912316957Sdchagincomplete zmore	n/*/f:*.{gz,Z,z,zip}/
913316957Sdchagincomplete zfile	n/*/f:*.{gz,Z,z,zip,taz,tgz}/
914316957Sdchagincomplete ztouch	n/*/f:*.{gz,Z,z,zip,taz,tgz}/
915316957Sdchagincomplete zforce	n/*/f:^*.{gz,tgz}/
91659243Sobrien
917316957Sdchagincomplete dcop 'p/1/`$:0`/ /' \
918316957Sdchagin    'p/2/`$:0 $:1 | awk \{print\ \$1\}`/ /' \
919316957Sdchagin    'p/3/`$:0 $:1 $:2 | sed "s%.* \(.*\)(.*%\1%"`/ /'
920131962Smp
921131962Smp
922316957Sdchagincomplete grep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
923316957Sdchagin		    c/--/"(extended-regexp fixed-regexp basic-regexp \
924316957Sdchagin		    regexp file ignore-case word-regexp line-regexp \
925316957Sdchagin		    no-messages revert-match version help byte-offset \
926316957Sdchagin		    line-number with-filename no-filename quiet silent \
927316957Sdchagin		    text directories recursive files-without-match \
928316957Sdchagin		    files-with-matches count before-context after-context \
929316957Sdchagin		    context binary unix-byte-offsets)"/ \
930316957Sdchagin		    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 \
931316957Sdchagin			    v w x)"/ \
932316957Sdchagin		    p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
933316957Sdchagin		    n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
934316957Sdchagincomplete egrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
935316957Sdchagin		    c/--/"(extended-regexp fixed-regexp basic-regexp \
936316957Sdchagin		    regexp file ignore-case word-regexp line-regexp \
937316957Sdchagin		    no-messages revert-match version help byte-offset \
938316957Sdchagin		    line-number with-filename no-filename quiet silent \
939316957Sdchagin		    text directories recursive files-without-match \
940316957Sdchagin		    files-with-matches count before-context after-context \
941316957Sdchagin		    context binary unix-byte-offsets)"/ \
942316957Sdchagin		    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 \
943316957Sdchagin			    v w x)"/ \
944316957Sdchagin		    p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
945316957Sdchagin		    n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
946316957Sdchagincomplete fgrep	c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
947316957Sdchagin		    c/--/"(extended-regexp fixed-regexp basic-regexp \
948316957Sdchagin		    regexp file ignore-case word-regexp line-regexp \
949316957Sdchagin		    no-messages revert-match version help byte-offset \
950316957Sdchagin		    line-number with-filename no-filename quiet silent \
951316957Sdchagin		    text directories recursive files-without-match \
952316957Sdchagin		    files-with-matches count before-context after-context \
953316957Sdchagin		    context binary unix-byte-offsets)"/ \
954316957Sdchagin		    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 \
955316957Sdchagin			    v w x)"/ \
956316957Sdchagin		    p/1/x:'<fixed_string>'/ N/-*e/f/ \
957316957Sdchagin		    n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
95859243Sobrien
959316957Sdchagincomplete sed	c/--/"(quiet silent version help expression file)"/   \
960316957Sdchagin		    c/-/"(n V e f -)"/ n/{-e,--expression}/x:'<script>'/  \
961316957Sdchagin		    n/{-f,--file}/f:*.sed/ N/-{e,f,-{file,expression}}/f/ \
962316957Sdchagin		    n/-/x:'<script>'/ N/-/f/ p/1/x:'<script>'/ p/2/f/
963100616Smp
964316957Sdchagincomplete users	c/--/"(help version)"/ p/1/x:'<accounting_file>'/
965316957Sdchagincomplete who	c/--/"(heading idle count mesg message writable help \
966316957Sdchagin		    version)"/ c/-/"(H i m q s T w u -)"/ \
967316957Sdchagin		    p/1/x:'<accounting_file>'/ n/am/"(i)"/ n/are/"(you)"/
96859243Sobrien
969316957Sdchagincomplete chown	c/--/"(changes dereference no-dereference silent \
970316957Sdchagin		    quiet reference recursive verbose help version)"/ \
971316957Sdchagin		    c/-/"(c f h R v -)"/ C@[./\$~]@f@ c/*[.:]/g/ \
972316957Sdchagin		    n/-/u/: p/1/u/: n/*/f/
973316957Sdchagincomplete chgrp	c/--/"(changes no-dereference silent quiet reference \
974316957Sdchagin		    recursive verbose help version)"/ \
975316957Sdchagin		    c/-/"(c f h R v -)"/ n/-/g/ p/1/g/ n/*/f/
976316957Sdchagincomplete chmod	c/--/"(changes silent quiet verbose reference \
977316957Sdchagin		    recursive help version)"/ c/-/"(c f R v)"/
978316957Sdchagincomplete df		c/--/"(all block-size human-readable si inodes \
979316957Sdchagin		    kilobytes local megabytes no-sync portability sync \
980316957Sdchagin		    type print-type exclude-type help version)"/ \
981316957Sdchagin		    c/-/"(a H h i k l m P T t v x)"/
982316957Sdchagincomplete du		c/--/"(all block-size bytes total dereference-args \
983316957Sdchagin		    human-readable si kilobytes count-links dereference \
984316957Sdchagin		    megabytes separate-dirs summarize one-file-system \
985316957Sdchagin		    exclude-from exclude max-depth help version"/ \
986316957Sdchagin		    c/-/"(a b c D H h k L l m S s X x)"/
98759243Sobrien
988316957Sdchagincomplete cat	c/--/"(number-nonblank number squeeze-blank show-all \
989316957Sdchagin		    show-nonprinting show-ends show-tabs help version)"/ \
990316957Sdchagin		    c/-/"(A b E e n s T t u v -)"/ n/*/f/
991316957Sdchagincomplete mv		c/--/"(backup force interactive update verbose suffix \
992316957Sdchagin		    version-control help version)"/ \
993316957Sdchagin		    c/-/"(b f i S u V v -)"/ \
994316957Sdchagin		    n/{-S,--suffix}/x:'<suffix>'/ \
995316957Sdchagin		    n/{-V,--version-control}/"(t numbered nil existing \
996316957Sdchagin		    never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
997316957Sdchagincomplete cp		c/--/"(archive backup no-dereference force \
998316957Sdchagin		    interactive link preserve parents sparse recursive \
999316957Sdchagin		    symbolic-link suffix update verbose version-control \
1000316957Sdchagin		    one-file-system help version)"/ \
1001316957Sdchagin		    c/-/"(a b d f i l P p R r S s u V v x -)"/ \
1002316957Sdchagin		    n/-*r/d/ n/{-S,--suffix}/x:'<suffix>'/ \
1003316957Sdchagin		    n/{-V,--version-control}/"(t numbered nil existing \
1004316957Sdchagin		    never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
1005316957Sdchagincomplete ln		c/--/"(backup directory force no-dereference \
1006316957Sdchagin		    interactive symbolic suffix verbose version-control \
1007316957Sdchagin		    help version)"/ \
1008316957Sdchagin		    c/-/"(b d F f i n S s V v -)"/ \
1009316957Sdchagin		    n/{-S,--suffix}/x:'<suffix>'/ \
1010316957Sdchagin		    n/{-V,--version-control}/"(t numbered nil existing \
1011316957Sdchagin		    never simple)"/ n/-*/f/ N/-*/x:'<link_name>'/ \
1012316957Sdchagin		    p/1/f/ p/2/x:'<link_name>'/
1013316957Sdchagincomplete touch	c/--/"(date reference time help version)"/ \
1014316957Sdchagin		    c/-/"(a c d f m r t -)"/ \
1015316957Sdchagin		    n/{-d,--date}/x:'<date_string>'/ \
1016316957Sdchagin		    c/--time/"(access atime mtime modify use)"/ \
1017316957Sdchagin		    n/{-r,--file}/f/ n/-t/x:'<time_stamp>'/ n/*/f/
1018316957Sdchagincomplete mkdir	c/--/"(mode parents verbose help version)"/ \
1019316957Sdchagin		    c/-/"(p m -)"/ \
1020316957Sdchagin		    n/{-m,--mode}/x:'<mode>'/ n/*/d/
1021316957Sdchagincomplete rmdir	c/--/"(ignore-fail-on-non-empty parents verbose help \
1022316957Sdchagin		    version)"/ c/-/"(p -)"/ n/*/d/
1023316957Sdchagincomplete env 	'c/*=/f/' 'p/1/e/=/' 'p/2/c/'
102459243Sobrien
1025316957Sdchagincomplete tar	c/-[Acru]*/"(b B C f F g G h i l L M N o P \
1026316957Sdchagin		    R S T v V w W X z Z)"/ \
1027316957Sdchagin		    c/-[dtx]*/"( B C f F g G i k K m M O p P \
1028316957Sdchagin		    R s S T v w x X z Z)"/ \
1029316957Sdchagin		    p/1/"(A c d r t u x -A -c -d -r -t -u -x \
1030316957Sdchagin		    --catenate --concatenate --create --diff --compare \
1031316957Sdchagin		    --delete --append --list --update --extract --get \
1032316957Sdchagin		    --help --version)"/ \
1033316957Sdchagin		    c/--/"(catenate concatenate create diff compare \
1034316957Sdchagin		    delete append list update extract get atime-preserve \
1035316957Sdchagin		    block-size read-full-blocks directory checkpoint file \
1036316957Sdchagin		    force-local info-script new-volume-script incremental \
1037316957Sdchagin		    listed-incremental dereference ignore-zeros \
1038316957Sdchagin		    ignore-failed-read keep-old-files starting-file \
1039316957Sdchagin		    one-file-system tape-length modification-time \
1040316957Sdchagin		    multi-volume after-date newer old-archive portability \
1041316957Sdchagin		    to-stdout same-permissions preserve-permissions \
1042316957Sdchagin		    absolute-paths preserve record-number remove-files \
1043316957Sdchagin		    same-order preserve-order same-owner sparse \
1044316957Sdchagin		    files-from null totals verbose label version \
1045316957Sdchagin		    interactive confirmation verify exclude exclude-from \
1046316957Sdchagin		    compress uncompress gzip ungzip use-compress-program \
1047316957Sdchagin		    block-compress help version)"/ \
1048316957Sdchagin		    c/-/"(b B C f F g G h i k K l L m M N o O p P R s S \
1049316957Sdchagin		    T v V w W X z Z 0 1 2 3 4 5 6 7 -)"/ \
1050316957Sdchagin		    C@/dev@f@ \
1051316957Sdchagin		    n/-c*f/x:'<new_tar_file, device_file, or "-">'/ \
1052316957Sdchagin		    n/{-[Adrtux]j*f,--file}/f:*.{tar.bz2,tbz}/ \
1053316957Sdchagin		    n/{-[Adrtux]z*f,--file}/f:*.{tar.gz,tgz}/ \
1054316957Sdchagin		    n/{-[Adrtux]Z*f,--file}/f:*.{tar.Z,taz}/ \
1055316957Sdchagin		    n/{-[Adrtux]*f,--file}/f:*.tar/ \
1056316957Sdchagin		    N/{-xj*f,--file}/'`tar -tjf $:-1`'/ \
1057316957Sdchagin		    N/{-xz*f,--file}/'`tar -tzf $:-1`'/ \
1058316957Sdchagin		    N/{-xZ*f,--file}/'`tar -tZf $:-1`'/ \
1059316957Sdchagin		    N/{-x*f,--file}/'`tar -tf $:-1`'/ \
1060316957Sdchagin		    n/--use-compress-program/c/ \
1061316957Sdchagin		    n/{-b,--block-size}/x:'<block_size>'/ \
1062316957Sdchagin		    n/{-V,--label}/x:'<volume_label>'/ \
1063316957Sdchagin		    n/{-N,--{after-date,newer}}/x:'<date>'/ \
1064316957Sdchagin		    n/{-L,--tape-length}/x:'<tape_length_in_kB>'/ \
1065316957Sdchagin		    n/{-C,--directory}/d/ \
1066316957Sdchagin		    N/{-C,--directory}/'`\ls $:-1`'/ \
1067316957Sdchagin		    n/-[0-7]/"(l m h)"/
106859243Sobrien
1069316957Sdchaginswitch ( "$OSTYPE" )
1070316957Sdchagincase linux:
1071316957Sdchagin  # Linux filesystems
1072316957Sdchagin  complete  mount	c/-/"(a f F h l n o r s t U v V w)"/ n/-[hV]/n/ \
1073316957Sdchagin		    n/-o/x:'<options>'/ n/-t/x:'<vfstype>'/ \
1074316957Sdchagin		    n/-L/x:'<label>'/ n/-U/x:'<uuid>'/ \
1075316957Sdchagin		    n@*@'`grep -v "^#" /etc/fstab | tr -s " " "	 " | cut -f 2`'@
1076316957Sdchagin  complete umount	c/-/"(a h n r t v V)"/ n/-t/x:'<vfstype>'/ \
1077316957Sdchagin		      n/*/'`mount | cut -d " " -f 3`'/
1078316957Sdchagin  breaksw
1079316957Sdchagincase sunos*:
1080316957Sdchagincase solaris:
1081316957Sdchagin  # Solaris filesystems
1082316957Sdchagin  complete  mount	c/-/"(a F m o O p r v V)"/ n/-p/n/ n/-v/n/ \
1083316957Sdchagin		    n/-o/x:'<FSType_options>'/ \
1084316957Sdchagin		    n@-F@'`\ls -1 /usr/lib/fs`'@ \
1085316957Sdchagin		    n@*@'`grep -v "^#" /etc/vfstab | tr -s " " "	 " | cut -f 3`'@
1086316957Sdchagin  complete umount	c/-/"(a o V)"/ n/-o/x:'<FSType_options>'/ \
1087316957Sdchagin		    n/*/'`mount | cut -d " " -f 1`'/
1088316957Sdchagin  complete  mountall	c/-/"(F l r)"/ n@-F@'`\ls -1 /usr/lib/fs`'@
1089316957Sdchagin  complete umountall	c/-/"(F h k l r s)"/ n@-F@'`\ls -1 /usr/lib/fs`'@ \
1090316957Sdchagin		    n/-h/'`df -k | cut -s -d ":" -f 1 | sort -u`'/
1091316957Sdchagin  breaksw
1092316957Sdchagincase cygwin:
1093316957Sdchagin  # Cygwin mounts
1094316957Sdchagin  complete  mount	c/-/"(b c f h m o p s t u v x E X)"/ n/-[hmpv]/n/ \
1095316957Sdchagin		    n/-c/x:'/'/ \
1096316957Sdchagin		    n/-o/"(user system binary text exec notexec cygexec nosuid managed)"/ \
1097316957Sdchagin		    n@*@'`mount -p | tail -1 | cut -d " " -f 1 | xargs ls -1 | awk '"'"'{print $1":/"; } END{print "//";}'"'"'`'@
1098316957Sdchagin  complete umount	c/-/"(A c h s S u U v)"/ n/-[AhSUv]/n/ \
1099316957Sdchagin		    n@*@'`mount | grep -v noumount | cut -d " " -f 3`'@
1100316957Sdchagin  breaksw
1101316957Sdchaginendsw
110259243Sobrien
1103316957Sdchagin# these deal with NIS (formerly YP); if it's not running you don't need 'em
1104316957Sdchaginif (-X domainname) then
1105316957Sdchagin  set _domain = "`domainname`"
1106316957Sdchagin  set _ypdir  = /var/yp	# directory where NIS (YP) maps are kept
1107316957Sdchagin  if ("$_domain" != "" && "$_domain" != "noname") then
1108316957Sdchagin    complete domainname p@1@D:$_ypdir@" " n@*@n@
1109316957Sdchagin    complete ypcat	    c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
1110316957Sdchagin			N@-d@\`\\ls\ -1\ $_ypdir/\$:-1\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
1111316957Sdchagin			n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
1112316957Sdchagin    complete ypmatch    c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
1113316957Sdchagin			N@-d@x:'<key ...>'@ n@-@x:'<key ...>'@ p@1@x:'<key ...>'@ \
1114316957Sdchagin			n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
1115316957Sdchagin    complete ypwhich    c@-@"(d m t x V1 V2)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
1116316957Sdchagin			n@-m@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
1117316957Sdchagin			N@-m@n@ n@*@\$hosts@
1118316957Sdchagin  endif
1119316957Sdchagin  unset _domain _ypdir
1120316957Sdchaginendif
112159243Sobrien
1122316957Sdchagincomplete make \
1123316957Sdchagin    'n/-f/f/' \
1124316957Sdchagin    'c/*=/f/' \
1125316957Sdchagin    'n@*@`cat -s GNUmakefile Makefile makefile |& sed -n -e "/No such file/d" -e "/^[^     #].*:/s/:.*//p"`@'
112659243Sobrien
1127316957Sdchaginif ( -f /etc/printcap ) then
1128316957Sdchagin    set printers=(`sed -n -e "/^[^     #].*:/s/:.*//p" /etc/printcap`)
112959243Sobrien
1130316957Sdchagin    complete lpr    'c/-P/$printers/'
1131316957Sdchagin    complete lpq    'c/-P/$printers/'
1132316957Sdchagin    complete lprm   'c/-P/$printers/'
1133316957Sdchagin    complete lpquota        'p/1/(-Qprlogger)/' 'c/-P/$printers/'
1134316957Sdchagin    complete dvips  'c/-P/$printers/' 'n/-o/f:*.{ps,PS}/' 'n/*/f:*.dvi/'
1135316957Sdchagin    complete dvilj	'p/*/f:*.dvi/'
1136316957Sdchaginendif
113759243Sobrien
1138316957Sdchagin# From Alphonse Bendt
1139316957Sdchagincomplete ant \
1140316957Sdchagin     'n/-f/f:*.xml/' \
1141316957Sdchagin	  'n@*@`cat build.xml | sed -n -e "s/[ \t]*<target[\t\n]*name=.\([a-zA-Z0-9_:]*\).*/\1/p"`@'
1142131962Smp
1143316957Sdchaginif ($?P4CLIENT && -X perl) then
1144316957Sdchagin    # This is from Greg Allen.
1145316957Sdchagin    set p4cmds=(add branch branches commands change changes client clients \
1146316957Sdchagin	counter counters delete depot depots describe diff diff2 \
1147316957Sdchagin	edit filelog files fix fixes fstat group groups have help \
1148316957Sdchagin	info integrate integrated job jobs jobspec label labels \
1149316957Sdchagin	labelsync lock obliterate opened passwd print protect rename \
1150316957Sdchagin	reopen resolve resolved revert review reviews set submit \
1151316957Sdchagin	sync triggers unlock user users verify where)
1152316957Sdchagin    complete p4 'p/1/$p4cmds/' 'n/help/$p4cmds/' \
1153316957Sdchagin	'n%{-l,label}%`p4 labels | sed "s/Label \([^ ]*\) .*/\1/"`%' \
1154316957Sdchagin	'n%-t%`p4 $:1s | sed "s/[^ ]* \([^ ]*\) .*/\1/"`%' \
1155316957Sdchagin	'c%*@%`p4 labels | sed "s/Label \([^ ]*\) .*/\1/"`%' \
1156316957Sdchagin	'c@//*/*@`p4 files $:-0... |& perl -nle "m%\Q$:-0\E([^#][^/# ] \
1157316957Sdchagin	*)%;print "\$"1 if \\\!/no such/&&\!"\$"h{"\$"1}++"`@@' \
1158316957Sdchagin	'c@//@`p4 depots | sed "s/Depot \([^ ]*\) .*/\1/"`@/@'
1159316957Sdchaginendif
1160131962Smp
1161131962Smp
1162316957Sdchaginif (! $?traditional_complete) then
1163316957Sdchagin    uncomplete vi
1164316957Sdchagin    uncomplete vim
1165316957Sdchagin    complete {vi,vim,gvim,nvi,elvis} 	n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/
1166316957Sdchagin    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}/'
1167316957Sdchagin    complete elm	'n/-[Ai]/f/' 'c@=@F:$HOME/Mail/@' 'n/-s/x:\<subject\>/'
1168316957Sdchagin    complete ncftp	'n@*@`sed -e '1,2d' $HOME/.ncftp/bookmarks | cut -f 1,2 -d "," | tr "," "\012" | sort | uniq ` '@
1169316957Sdchagin    complete bibtex	'n@*@`ls *.aux | sed -e "s/\.aux//"`'@
1170316957Sdchagin    complete dvi2tty	n/*/f:*.dvi/	# Only files that match *.dvi
1171316957Sdchagin    uncomplete gv
1172316957Sdchagin    uncomplete ghostview
1173316957Sdchagin    complete {gv,ghostview}	'n/*/f:*.{ps,eps,epsi}/'
1174316957Sdchagin    complete enscript \
1175316957Sdchagin	    'c/--/(columns= pages= header= no-header truncate-lines \
1176316957Sdchagin		    line-numbers setpagedevice= escapes font= \
1177316957Sdchagin		    header-font= fancy-header no-job-header \
1178316957Sdchagin		    highlight-bars indent= filter= borders page-prefeed \
1179316957Sdchagin		    no-page-prefeed lineprinter lines-per-page= mail \
1180316957Sdchagin		    media= copies= newline= output= missing-characters \
1181316957Sdchagin		    printer= quiet silent landscape portrait \
1182316957Sdchagin		    baselineskip= statusdict= title= tabsize= underlay= \
1183316957Sdchagin		    verbose version encoding pass-through download-font= \
1184316957Sdchagin		    filter-stdin= help highlight-bar-gray= list-media \
1185316957Sdchagin		    list-options non-printable-format= page-label-format= \
1186316957Sdchagin		    printer-options= ul-angle= ul-font= ul-gray= \
1187316957Sdchagin		    ul-position= ul-style= \
1188316957Sdchagin		 )/'
1189316957Sdchaginendif
1190131962Smp
1191316957Sdchagincomplete dpkg \
1192316957Sdchagin	    'c/--{admindir,instdir,root}=/d/' \
1193316957Sdchagin	    'c/--debug=/n/' \
1194316957Sdchagin	    'c/--{admindir,debug,instdir,root}/(=)//' \
1195316957Sdchagin	    'c/--/(admindir= debug= instdir= root= \
1196316957Sdchagin		    assert-support-predepends assert-working-epoch \
1197316957Sdchagin		    audit auto-deconfigure clear-avail \
1198316957Sdchagin		    compare-versions configure contents control \
1199316957Sdchagin		    extract force-bad-path field \
1200316957Sdchagin		    force-configure-any force-conflicts \
1201316957Sdchagin		    force-depends force-depends-version force-help \
1202316957Sdchagin		    force-hold force-non-root \
1203316957Sdchagin		    force-overwrite-diverted \
1204316957Sdchagin		    force-remove-essential force-remove-reinstreq \
1205316957Sdchagin		    forget-old-unavail fsys-tarfile get-selections \
1206316957Sdchagin		    help ignore-depends info install largemem \
1207316957Sdchagin		    license list listfiles merge-avail no-act \
1208316957Sdchagin		    pending predep-package print-architecture \
1209316957Sdchagin		    print-gnu-build-architecture \
1210316957Sdchagin		    print-installation-architecture print-avail \
1211316957Sdchagin		    purge record-avail recursive refuse-downgrade \
1212316957Sdchagin		    remove search set-selections selected-only \
1213316957Sdchagin		    skip-same-version smallmem status unpack \
1214316957Sdchagin		    update-avail version vextract \
1215316957Sdchagin		  )//' \
1216316957Sdchagin	    'n/{-l}/`dpkg -l|awk \{print\ \$2\}`/' \
1217316957Sdchagin	    'n/*/f:*.deb'/
1218316957Sdchagincomplete dpkg-deb 	   'c/--{build}=/d/' \
1219316957Sdchagin		       'c/--/(build contents info field control extract \
1220316957Sdchagin			     vextract fsys-tarfile help version \
1221316957Sdchagin			     license)//' \
1222316957Sdchagin		       'n/*/f:*.deb/'
1223316957Sdchagincomplete apt-get \
1224316957Sdchagin	    'c/--/(build config-file diff-only download-only \
1225316957Sdchagin	       fix-broken fix-missing force-yes help ignore-hold no-download \
1226316957Sdchagin	       no-upgrade option print-uris purge reinstall quiet simulate \
1227316957Sdchagin	       show-upgraded target-release tar-only version yes )/' \
1228316957Sdchagin	    'c/-/(b c= d f h m o= q qq s t x y )/' \
1229316957Sdchagin	    'n/{source,build-dep}/x:<pkgname>/' \
1230316957Sdchagin	    'n/{remove}/`dpkg -l|grep ^ii|awk \{print\ \$2\}`/' \
1231316957Sdchagin	    'n/{install}/`apt-cache pkgnames | sort`/' \
1232316957Sdchagin	    'C/*/(update upgrade dselect-upgrade source \
1233316957Sdchagin	       build-dep check clean autoclean install remove)/'
1234316957Sdchagincomplete apt-cache \
1235316957Sdchagin	    'c/--/(all-versions config-file generate full help important \
1236316957Sdchagin	    names-only option pkg-cache quiet recurse src-cache version )/' \
1237316957Sdchagin	    'c/-/(c= h i o= p= q s= v)/' \
1238316957Sdchagin	    'n/{search}/x:<regex>/' \
1239316957Sdchagin	    'n/{pkgnames,policy,show,showpkg,depends,dotty}/`apt-cache pkgnames | sort`/' \
1240316957Sdchagin	    'C/*/(add gencaches showpkg stats dump dumpavail unmet show \
1241316957Sdchagin	    search depends pkgnames dotty policy )/'
1242131962Smp
1243316957Sdchaginswitch ( "${OSTYPE}" )
1244316957Sdchagincase FreeBSD:
1245316957Sdchagin  set commands=()
1246316957Sdchagin  foreach p (fast force one quiet "")
1247316957Sdchagin    foreach c (enabled poll rcvar reload restart start status stop)
1248316957Sdchagin      set commands=($commands $p$c)
1249316957Sdchagin    end
1250316957Sdchagin  end
1251316957Sdchagin  complete service \
1252316957Sdchagin    n/-R/n/ \
1253316957Sdchagin    n/-e/n/ \
1254316957Sdchagin    n/-l/n/ \
1255316957Sdchagin    n/-r/n/ \
1256316957Sdchagin    c/-/"(R e l r v)"/ \
1257316957Sdchagin    p/2/"($commands)"/ \
1258316957Sdchagin    p@1@'`service -l`'@
1259316957Sdchagin  unset commands c p
1260316957Sdchagin  breaksw
1261316957Sdchagincase linux:
1262316957Sdchagin  if ( -d /etc/init.d ) then
1263316957Sdchagin    set rcdir=/etc/init.d/
1264316957Sdchagin  else
1265316957Sdchagin    set rcdir=/etc/rc.d/
1266316957Sdchagin  endif
1267316957Sdchagin  complete service \
1268316957Sdchagin    p/2/"(--full-restart force-reload reload restart start stop status)"/ \
1269316957Sdchagin    c/--/"(help status-all version)"/ \
1270316957Sdchagin    c/-/"(- h)"/ \
1271316957Sdchagin    p@1@F:$rcdir@
1272316957Sdchagin  unset rcdir
1273316957Sdchagin  breaksw
1274316957Sdchaginendsw
127559243Sobrien
1276316957Sdchaginif ( $?_unset_noglob ) unset noglob _unset_noglob
1277316957Sdchagin
127859243Sobrienend:
1279316957Sdchaginunset _has_complete
1280316957Sdchaginonintr
1281