2 # $Id: complete.tcsh,v 1.36 2000/11/19 20:50:42 christos Exp $
3 # example file using the new completion code
7 if (! $?prompt) goto end
16 if ($rev > 5 && $rel > 1) then
25 foreach f ($HOME/.hosts /usr/local/etc/csh.hosts $HOME/.rhosts /etc/hosts.equiv)
27 set hosts = ($hosts `grep -v "+" $f | tr -s " " " " | cut -f 1`)
30 if ( -r $HOME/.netrc ) then
31 set f=`awk '/machine/ { print $2 }' < $HOME/.netrc` >& /dev/null
36 set hosts=(hyperion.ee.cornell.edu phaeton.ee.cornell.edu \
37 guillemin.ee.cornell.edu vangogh.cs.berkeley.edu \
38 ftp.uu.net prep.ai.mit.edu export.lcs.mit.edu \
39 labrea.stanford.edu sumex-aim.stanford.edu \
40 tut.cis.ohio-state.edu)
43 complete ywho n/*/\$hosts/ # argument from list in $hosts
44 complete rsh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
45 complete ssh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
46 complete xrsh p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
47 complete rlogin p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/
48 complete telnet p/1/\$hosts/ p/2/x:'<port>'/ n/*/n/
50 complete cd p/1/d/ # Directories only
56 complete complete p/1/X/ # Completions only
57 complete uncomplete n/*/X/
58 complete exec p/1/c/ # Commands only
60 complete strace p/1/c/
65 complete adb c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
67 complete dbx c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
69 complete gdb n/-d/d/ n/*/c/
71 complete set 'c/*=/f/' 'p/1/s/=' 'n/=/f/'
73 complete alias p/1/a/ # only aliases are valid
74 complete unalias n/*/a/
75 complete xdvi n/*/f:*.dvi/ # Only files that match *.dvi
76 complete dvips n/*/f:*.dvi/
77 complete tex n/*/f:*.tex/ # Only files that match *.tex
78 complete latex n/*/f:*.{tex,ltx}/
79 complete su c/--/"(login fast preserve-environment command shell \
80 help version)"/ c/-/"(f l m p c s -)"/ \
82 n@{-s,--shell}@'`cat /etc/shells`'@ n/*/u/
83 complete cc c/-[IL]/d/ \
84 c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
85 c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
86 complete acc c/-[IL]/d/ \
87 c@-l@'`\ls -1 /usr/lang/SC1.0/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
88 c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
89 complete gcc c/-[IL]/d/ \
90 c/-f/"(caller-saves cse-follow-jumps delayed-branch \
91 elide-constructors expensive-optimizations \
92 float-store force-addr force-mem inline \
93 inline-functions keep-inline-functions \
94 memoize-lookups no-default-inline \
95 no-defer-pop no-function-cse omit-frame-pointer \
96 rerun-cse-after-loop schedule-insns \
97 schedule-insns2 strength-reduce \
98 thread-jumps unroll-all-loops \
99 unroll-loops syntax-only all-virtual \
100 cond-mismatch dollars-in-identifiers \
101 enum-int-equiv no-asm no-builtin \
102 no-strict-prototype signed-bitfields \
103 signed-char this-is-variable unsigned-bitfields \
104 unsigned-char writable-strings call-saved-reg \
105 call-used-reg fixed-reg no-common \
106 no-gnu-binutils nonnull-objects \
107 pcc-struct-return pic PIC shared-data \
108 short-enums short-double volatile)"/ \
109 c/-W/"(all aggregate-return cast-align cast-qual \
110 comment conversion enum-clash error format \
111 id-clash-len implicit missing-prototypes \
112 no-parentheses pointer-arith return-type shadow \
113 strict-prototypes switch uninitialized unused \
115 c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd \
116 short c68000 c68020 soft-float g gnu unix fpu \
119 c/-/"(f W vspec v vpath ansi traditional \
120 traditional-cpp trigraphs pedantic x o l c g L \
121 I D U O O2 C E H B b V M MD MM i dynamic \
122 nodtdlib static nostdinc undef)"/ \
124 n/*/f:*.{c,C,cc,o,a,s,i}/
125 complete g++ n/*/f:*.{C,cc,o,s,i}/
126 complete CC n/*/f:*.{C,cc,cpp,o,s,i}/
127 complete rm c/--/"(directory force interactive verbose \
128 recursive help version)"/ c/-/"(d f i v r R -)"/ \
129 n/*/f:^*.{c,cc,C,h,in}/ # Protect precious files
130 complete vi n/*/f:^*.[oa]/
131 complete bindkey N/-a/b/ N/-c/c/ n/-[ascr]/'x:<key-sequence>'/ \
132 n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/\
133 n/-k/"(left right up down)"/ p/2-/b/ \
134 p/1/'x:<key-sequence or option>'/
136 complete find n/-fstype/"(nfs 4.2)"/ n/-name/f/ \
137 n/-type/"(c b d f p l s)"/ n/-user/u/ n/-group/g/ \
138 n/-exec/c/ n/-ok/c/ n/-cpio/f/ n/-ncpio/f/ n/-newer/f/ \
139 c/-/"(fstype name perm prune type user nouser \
140 group nogroup size inum atime mtime ctime exec \
141 ok print ls cpio ncpio newer xdev depth \
142 daystart follow maxdepth mindepth noleaf version \
143 anewer cnewer amin cmin mmin true false uid gid \
144 ilname iname ipath iregex links lname empty path \
145 regex used xtype fprint fprint0 fprintf \
146 print0 printf not a and o or)"/ \
149 complete -%* c/%/j/ # fill in the jobs builtin
150 complete {fg,bg,stop} c/%/j/ p/1/"(%)"//
152 complete limit c/-/"(h)"/ n/*/l/
153 complete unlimit c/-/"(h)"/ n/*/l/
155 complete -co* p/0/"(compress)"/ # make compress completion
157 complete zcat n/*/f:*.Z/
159 complete finger c/*@/\$hosts/ n/*/u/@
160 complete ping p/1/\$hosts/
161 complete traceroute p/1/\$hosts/
163 complete {talk,ntalk,phone} p/1/'`users | tr " " "\012" | uniq`'/ \
164 n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/
166 complete ftp c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/
168 # this one is simple...
169 #complete rcp c/*:/f/ C@[./\$~]*@f@ n/*/\$hosts/:
170 # From Michael Schroeder <mlschroe@immd4.informatik.uni-erlangen.de>
171 # This one will rsh to the file to fetch the list of files!
172 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/:'
174 complete dd c/--/"(help version)"/ c/[io]f=/f/ \
175 c/conv=*,/"(ascii ebcdic ibm block unblock \
176 lcase notrunc ucase swab noerror sync)"/,\
177 c/conv=/"(ascii ebcdic ibm block unblock \
178 lcase notrunc ucase swab noerror sync)"/,\
180 n/*/"(if of conv ibs obs bs cbs files skip file seek count)"/=
182 complete nslookup p/1/x:'<host>'/ p/2/\$hosts/
184 complete ar c/[dmpqrtx]/"(c l o u v a b i)"/ p/1/"(d m p q r t x)"// \
185 p/2/f:*.a/ p/*/f:*.o/
187 # these should be merged with the MH completion hacks below - jgotts
188 complete {sprev,snext} \
191 # these and interrupt handling from Jaap Vermeulen <jaap@sequent.com>
192 complete {rexec,rxexec,rxterm,rmterm} \
193 'p/1/$hosts/' 'c/-/(l L E)/' 'n/-l/u/' 'n/-L/f/' \
195 complete kill 'c/-/S/' 'c/%/j/' \
196 'n/*/`ps -u $LOGNAME | awk '"'"'{print $1}'"'"'`/'
198 # these from Marc Horowitz <marc@cam.ov.com>
199 complete attach 'n/-mountpoint/d/' 'n/-m/d/' 'n/-type/(afs nfs rvd ufs)/' \
200 'n/-t/(afs nfs rvd ufs)/' 'n/-user/u/' 'n/-U/u/' \
201 'c/-/(verbose quiet force printpath lookup debug map \
202 nomap remap zephyr nozephyr readonly write \
203 mountpoint noexplicit explicit type mountoptions \
204 nosetuid setuid override skipfsck lock user host)/' \
206 complete hesinfo 'p/1/u/' \
207 'p/2/(passwd group uid grplist pcap pobox cluster \
208 filsys sloc service)/'
210 # these from E. Jay Berkenbilt <ejb@ERA.COM>
211 # = isn't always followed by a filename or a path anymore - jgotts
212 complete ./configure 'c/--*=/f/' 'c/--{cache-file,prefix,exec-prefix,\
213 bindir,sbindir,libexecdir,datadir,\
214 sysconfdir,sharedstatedir,localstatedir,\
215 libdir,includedir,oldincludedir,infodir,\
216 mandir,srcdir}/(=)//' \
217 'c/--/(cache-file verbose prefix exec-prefix bindir \
218 sbindir libexecdir datadir sysconfdir \
219 sharedstatedir localstatedir libdir \
220 includedir oldincludedir infodir mandir \
222 complete gs 'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc \
223 dfaxhigh dfaxlow laserjet ljet4 sparc pbm \
224 pbmraw pgm pgmraw ppm ppmraw bit)/' \
225 'c/-sOutputFile=/f/' 'c/-s/(DEVICE OutputFile)/=' \
226 'c/-d/(NODISPLAY NOPLATFONTS NOPAUSE)/' 'n/*/f/'
227 complete perl 'n/-S/c/'
228 complete printenv 'n/*/e/'
229 complete sccs p/1/"(admin cdc check clean comb deledit delget \
230 delta diffs edit enter fix get help info \
231 print prs prt rmdel sccsdiff tell unedit \
233 complete setenv 'p/1/e/' 'c/*:/f/'
235 # these and method of setting hosts from Kimmo Suominen <kim@tac.nyc.ny.us>
236 if ( -f $HOME/.mh_profile && -x "`which folders`" ) then
238 if ( ! $?FOLDERS ) setenv FOLDERS "`folders -fast -recurse`"
239 if ( ! $?MHA ) setenv MHA "`ali | sed -e '/^ /d' -e 's/:.*//'`"
241 set folders = ( $FOLDERS )
245 'c/-/(alias nolist list nonormalize normalize nouser user help)/' \
249 'c/-/(component noinplace inplace nodate date text help)/' \
251 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
254 'c/-/(noinplace inplace noquiet quiet noverbose verbose help)/' \
256 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
259 'c/-/(draftfolder draftmessage nodraftfolder editor noedit file form nouse use whatnowproc nowhatnowproc help)/' \
261 'n,-whatnowproc,c,' \
264 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
267 'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit form noinplace inplace whatnowproc nowhatnowproc help)/' \
269 'n,-whatnowproc,c,' \
271 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
274 'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
276 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
279 'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
281 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
284 'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit filter form noformat format noinplace inplace digest issue volume whatnowproc nowhatnowproc help)/' \
286 'n,-whatnowproc,c,' \
289 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
292 'c/-/(audit file noaudit nochangecur changecur file form format nosilent silent notruncate truncate width help)/' \
298 'c/-/(add delete list sequence nopublic public nozero zero help)/' \
300 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
303 'c/-/(body cc from subject help)/' \
311 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
314 'c/-/(nodate date nonotify notify help)/'
317 'c/-/(prompt noscan scan notopcur topcur help)/'
320 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
329 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
332 'c/-/(and or not lbrace rbrace cc date from search subject to othercomponent after before datefield sequence nopublic public nozero zero nolist list help)/' \
334 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
337 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
344 'c/-/(erase kill noprepend prepend norapid rapid nodoteof doteof help)/'
347 'c/-/(draft nolink link nopreserve preserve src file help)/' \
350 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
353 'c/-/(nointeractive interactive help)/' \
359 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
362 'c/-/(noclear clear form format noheader header width noreverse reverse file help)/' \
366 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
369 'c/-/(alias draft draftfolder draftmessage nodraftfolder filter nofilter noformat format noforward forward nomsgid msgid nopush push noverbose verbose nowatch watch width help)/' \
374 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
379 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
382 'c/-/(datefield textfield notextfield limit nolimit noverbose verbose help)/' \
384 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
387 'c/-/(prompt vmhproc novmhproc help)/' \
391 'c/-/(draftfolder draftmessage nodraftfolder editor noedit prompt help)/'
394 'c/-/(alias nocheck check draft draftfolder draftmessage nodraftfolder help)/' \
400 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
408 #from Dan Nicolaescu <dann@ics.uci.edu>
409 if ( $?MODULESHOME ) then
410 alias Compl_module 'find ${MODULEPATH:as/:/ /} -name .version -o -name .modulea\* -prune -o -print | sed `echo "-e s@${MODULEPATH:as%:%/\*@@g -e s@%}/\*@@g"`'
411 complete module 'p%1%(add load unload switch display avail use unuse update purge list clear help initadd initrm initswitch initlist initclear)%' \
412 'n%{unl*,sw*,inits*}%`echo "$LOADEDMODULES:as/:/ /"`%' \
413 'n%{lo*,di*,he*,inita*,initr*}%`eval Compl_module`%' \
414 'N%{sw*,initsw*}%`eval Compl_module`%' 'C%-%(-append)%' 'n%{use,unu*,av*}%d%' 'n%-append%d%' \
415 'C%[^-]*%`eval Compl_module`%'
419 complete acroread 'p/*/f:*.pdf/'
420 complete apachectl 'c/*/(start stop restart fullstatus status graceful \
422 complete appletviewer 'p/*/f:*.class/'
423 complete bison 'c/--/(debug defines file-prefix= fixed-output-files \
424 help name-prefix= no-lines no-parser output= \
425 token-table verbose version yacc)/' \
426 'c/-/(b d h k l n o p t v y V)/' 'n/-b/f/' 'n/-o/f/' \
428 complete bunzip2 'p/*/f:*.bz2/'
429 complete bzip2 'n/-9/f:^*.bz2/' 'n/-d/f:*.bz2/'
430 complete c++ 'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
431 complete co 'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
432 complete crontab 'n/-u/u/'
433 complete camcontrol 'p/1/(cmd debug defects devlist eject inquiry \
434 modepage negotiate periphlist rescan reset start \
436 complete ctlinnd 'p/1/(addhist allow begin cancel changegroup \
437 checkfile drop feedinfo flush flushlogs go hangup \
438 logmode mode name newgroup param pause readers refile \
439 reject reload renumber reserve rmgroup send shutdown \
440 kill throttle trace xabort xexec)/'
441 complete cvs 'c/--/(help help-commands help-synonyms)/' \
442 'p/1/(add admin annotate checkout commit diff \
443 edit editors export history import init log login \
444 logout rdiff release remove rtag status tag unedit \
445 update watch watchers)/' 'n/-a/(edit unedit commit \
446 all none)/' 'n/watch/(on off add remove)/'
447 complete cxx 'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
448 complete detex 'p/*/f:*.tex/'
449 complete edquota 'n/*/u/'
450 complete exec 'p/1/c/'
451 complete ghostview 'p/*/f:*.ps/'
452 complete gv 'p/*/f:*.ps/'
453 complete ifconfig 'p@1@`ifconfig -l`@' 'n/*/(range phase link netmask \
454 mtu vlandev vlan metric mediaopt down delete \
455 broadcast arp debug)/'
456 complete imake 'c/-I/d/'
457 complete ipfw 'p/1/(flush add delete list show zero)/' \
458 'n/add/(allow permit accept pass deny drop reject \
459 reset count skipto num divert port tee port)/'
460 complete javac 'p/*/f:*.java/'
461 complete ldif2ldbm 'n/-i/f:*.ldif/'
462 complete libtool 'c/--mode=/(compile execute finish install link \
463 uninstall)/' 'c/--/(config debug dry-run features \
464 finish help quiet silent version mode=)/'
465 complete libtoolize 'c/--/(automake copy debug dry-run force help ltdl \
467 complete links 'c/-/(assume-codepage async-dns download-dir \
468 format-cache-size ftp-proxy help http-proxy \
469 max-connections max-connections-to-host \
470 memory-cache-size receive-timeout retries \
471 unrestartable-receive-timeout version)/'
472 complete natd c/-/'(alias_address config deny_incoming dynamic \
473 inport interface log log_denied log_facility \
474 outport outport port pptpalias proxy_only \
475 proxy_rule redirect_address redirect_port \
476 reverse same_ports unregistered_only use_sockets \
477 verbose)'/ 'n@-interface@`ifconfig -l`@'
478 complete netstat 'n@-I@`ifconfig -l`@'
479 complete objdump 'c/--/(adjust-vma= all-headers architecture= \
480 archive-headers debugging demangle disassemble \
481 disassemble-all disassemble-zeroes dynamic-reloc \
482 dynamic-syms endian= file-headers full-contents \
483 headers help info line-numbers no-show-raw-insn \
484 prefix-addresses private-headers reloc section-headers \
485 section=source stabs start-address= stop-address= \
486 syms target= version wide)/' \
487 'c/-/(a h i f C d D p r R t T x s S l w)/'
488 complete xmodmap 'c/-/(display help grammar verbose quiet n e pm pk \
490 complete lynx 'c/-/(accept_all_cookies anonymous assume_charset= \
491 assume_local_charset= assume_unrec_charset= auth= base \
492 book buried_news cache= case cfg= child cookie_file= \
493 cookies core crawl debug_partial display= dump editor= \
494 emacskeys enable_scrollback error_file= force_html \
495 force_secure forms_options from ftp get_data head help \
496 hiddenlinks= historical homepage= image_links index= \
497 ismap link= localhost mime_header minimal \
498 newschunksize= newsmaxchunk= nobrowse nocc nocolor \
499 nofilereferer nolist nolog nopause noprint noredir \
500 noreferer nostatus number_links partial partial_thres \
501 pauth= popup post_data preparsed print pseudo_inlines \
502 raw realm reload restrictions= resubmit_posts rlogin \
503 selective show_cursor soft_dquotes source stack_dump \
504 startfile_ok tagsoup telnet term= tlog trace traversal \
505 underscore useragent= validate verbose version vikeys \
506 width=)/' 'c/(http|ftp)/$URLS/'
507 complete gmake 'c/{--directory=,--include-dir=}/d/' \
508 'c/{--assume-new,--assume-old,--makefile,--new-file,--what-if,--file}/f/' \
509 'c/--/(assume-new= assume-old= debug directory= \
510 dry-run environment-overrides file= help \
511 ignore-errors include-dir= jobs[=N] just-print \
512 keep-going load-average[=N] makefile= max-load[=N] \
513 new-file= no-builtin-rules no-keep-going \
514 no-print-directory old-file= print-data-base \
515 print-directory question quiet recon silent stop \
516 touch version warn-undefined-variables what-if=)/' \
517 'n@*@`cat -s GNUMakefile Makefile makefile |& sed -n -e "/No such file/d" -e "s/^\([A-Za-z0-9-]*\):.*/\1/p"`@' \
519 complete mixer p/1/'(vol bass treble synth pcm speaker mic cd mix \
520 pcm2 rec igain ogain line1 line2 line3)'/ \
521 p@2@'`mixer $:-1 | awk \{\ print\ \$7\ \}`'@
523 complete mpg123 'c/--/(2to1 4to1 8bit aggressive au audiodevice \
524 auth buffer cdr check doublespeed equalizer frames \
525 gain halfspeed headphones left lineout list mix mono \
526 proxy quiet random rate reopen resync right scale \
527 shuffle single0 single1 skip speaker stdout stereo \
529 complete mysqladmin 'n/*/(create drop extended-status flush-hosts \
530 flush-logs flush-status flush-tables flush-privileges \
531 kill password ping processlist reload refresh \
532 shutdown status variables version)/'
533 complete mutt c@-f=@F:${HOME}/Mail/@ \
536 n/-s/x:'<subject line>'/ \
537 n/-e/x:'<command>'/ \
538 n@-b@'`cat ${HOME}/.muttrc-alias | awk '"'"'{print $2 }'"'"\`@ \
539 n@-c@'`cat ${HOME}/.muttrc-alias | awk '"'"'{print $2 }'"'"\`@ \
540 n@*@'`cat ${HOME}/.muttrc-alias | awk '"'"'{print $2 }'"'"\`@
541 complete ndc 'n/*/(status dumpdb reload stats trace notrace \
542 querylog start stop restart )/'
543 complete nm 'c/--/(debug-syms defined-only demangle dynamic \
544 extern-only format= help line-numbers no-demangle \
545 no-sort numeric-sort portability print-armap \
546 print-file-name reverse-sort size-sort undefined-only \
547 version)/' 'p/*/f:^*.{h,C,c,cc}/'
548 complete nmap 'n@-e@`ifconfig -l`@' 'p/*/$hostnames/'
549 complete perldoc 'n@*@`\ls -1 /usr/libdata/perl/5.*/pod | sed s%\\.pod.\*\$%%`@'
550 complete postfix 'n/*/(start stop reload abort flush check)/'
551 complete postmap 'n/1/(hash: regexp:)' 'c/hash:/f/' 'c/regexp:/f/'
552 complete rcsdiff 'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
553 complete X 'c/-/(I a ac allowMouseOpenFail allowNonLocalModInDev \
554 allowNonLocalXvidtune ar1 ar2 audit auth bestRefresh \
555 bgamma bpp broadcast bs c cc class co core deferglyphs \
556 disableModInDev disableVidMode displayID dpi dpms f fc \
557 flipPixels fn fp gamma ggamma help indirect kb keeptty \
558 ld lf logo ls nolisten string noloadxkb nolock nopn \
559 once p pn port probeonly query quiet r rgamma s \
560 showconfig sp su t terminate to tst v verbose version \
561 weight wm x xkbdb xkbmap)/'
562 complete users 'c/--/(help version)/' 'p/1/x:"<accounting_file>"/'
563 complete vidcontrol 'p/1/(132x25 132x30 132x43 132x50 132x60 40x25 80x25 \
564 80x30 80x43 80x50 80x60 EGA_80x25 EGA_80x43 \
565 VESA_132x25 VESA_132x30 VESA_132x43 VESA_132x50 \
566 VESA_132x60 VESA_800x600 VGA_320x200 VGA_40x25 \
567 VGA_80x25 VGA_80x30 VGA_80x50 VGA_80x60)/'
568 complete vim 'n/*/f:^*.[oa]/'
569 complete where 'n/*/c/'
570 complete which 'n/*/c/'
571 complete wmsetbg 'c/-/(display D S a b c d e m p s t u w)/' \
572 'c/--/(back-color center colors dither help match \
573 maxscale parse scale smooth tile update-domain \
574 update-wmaker version workspace)/'
575 complete xdb 'p/1/c/'
576 complete xdvi 'c/-/(allowshell debug display expert gamma hushchars \
577 hushchecksums hushspecials install interpreter keep \
578 margins nogrey noinstall nomakepk noscan paper safer \
579 shrinkbuttonn thorough topmargin underlink version)/' \
580 'n/-paper/(a4 a4r a5 a5r)/' 'p/*/f:*.dvi/'
581 complete xlock 'c/-/(allowaccess allowroot debug description \
582 echokeys enablesaver grabmouse grabserver hide inroot \
583 install inwindow mono mousemotion nolock remote \
584 resetsaver sound timeelapsed use3d usefirst verbose \
585 wireframe background batchcount bg bitmap both3d \
586 count cycles delay delta3d display dpmsoff \
587 dpmsstandby dpmssuspend endCmd erasedelay erasemode \
588 erasetime fg font foreground geometry help \
589 icongeometry info invalid left3d lockdelay logoutCmd \
590 mailCmd mailIcon message messagefile messagefont \
591 messagesfile mode name ncolors nice nomailIcon none3d \
592 parent password planfont program resources right3d \
593 saturation size startCmd timeout username validate \
594 version visual)/' 'n/-mode/(ant atlantis ball bat \
595 blot bouboule bounce braid bubble bubble3d bug cage \
596 cartoon clock coral crystal daisy dclock decay deco \
597 demon dilemma discrete drift eyes fadeplot flag flame \
598 flow forest galaxy gears goop grav helix hop hyper \
599 ico ifs image invert julia kaleid kumppa lament laser \
600 life life1d life3d lightning lisa lissie loop lyapunov \
601 mandelbrot marquee matrix maze moebius morph3d \
602 mountain munch nose pacman penrose petal pipes puzzle \
603 pyro qix roll rotor rubik shape sierpinski slip sphere \
604 spiral spline sproingies stairs star starfish strange \
605 superquadrics swarm swirl tetris thornbird triangle \
606 tube turtle vines voters wator wire world worm xjack \
608 complete xfig 'c/-/(display)/' 'p/*/f:*.fig/'
609 complete wget c/--/"(accept= append-output= background cache= \
610 continue convert-links cut-dirs= debug \
611 delete-after directory-prefix= domains= \
612 dont-remove-listing dot-style= exclude-directories= \
613 exclude-domains= execute= follow-ftp \
614 force-directories force-html glob= header= help \
615 http-passwd= http-user= ignore-length \
616 include-directories= input-file= level= mirror \
617 no-clobber no-directories no-host-directories \
618 no-host-lookup no-parent non-verbose \
619 output-document= output-file= passive-ftp \
620 proxy-passwd= proxy-user= proxy= quiet quota= \
621 recursive reject= relative retr-symlinks save-headers \
622 server-response span-hosts spider timeout= \
623 timestamping tries= user-agent= verbose version wait=)"/
625 # these from Tom Warzeka <tom@waz.cc>
626 # you may need to set the following variables for your host
627 set _elispdir = /usr/local/share/emacs/20.7/lisp # GNU Emacs lisp directory
628 set _maildir = /var/spool/mail # Post Office: /var/spool/mail or /usr/mail
629 set _ypdir = /var/yp # directory where NIS (YP) maps are kept
630 set _domain = "`domainname`"
632 # this one works but is slow and doesn't descend into subdirectories
633 # complete cd C@[./\$~]*@d@ \
634 # p@1@'`\ls -1F . $cdpath | grep /\$ | sort -u`'@ n@*@n@
636 if ( -r /etc/shells ) then
637 complete setenv p@1@e@ n@DISPLAY@\$hosts@: n@SHELL@'`cat /etc/shells`'@
639 complete setenv p@1@e@ n@DISPLAY@\$hosts@:
641 complete unsetenv n/*/e/
643 if (-r $HOME/.mailrc) then
644 complete mail c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
645 c@+@F:$HOME/Mail@ C@[./\$~]@f@ n/-s/x:'<subject>'/ \
646 n@-u@T:$_maildir@ n/-f/f/ \
647 n@*@'`sed -n s/alias//p $HOME/.mailrc | tr -s " " " " | cut -f 2`'@
649 complete mail c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
650 c@+@F:$HOME/Mail@ C@[./\$~]@f@ n/-s/x:'<subject>'/ \
651 n@-u@T:$_maildir@ n/-f/f/ n/*/u/
654 complete man n@1@'`\ls -1 /usr/man/man1 | sed s%\\.1.\*\$%%`'@ \
655 n@2@'`\ls -1 /usr/man/man2 | sed s%\\.2.\*\$%%`'@ \
656 n@3@'`\ls -1 /usr/man/man3 | sed s%\\.3.\*\$%%`'@ \
657 n@4@'`\ls -1 /usr/man/man4 | sed s%\\.4.\*\$%%`'@ \
658 n@5@'`\ls -1 /usr/man/man5 | sed s%\\.5.\*\$%%`'@ \
659 n@6@'`\ls -1 /usr/man/man6 | sed s%\\.6.\*\$%%`'@ \
660 n@7@'`\ls -1 /usr/man/man7 | sed s%\\.7.\*\$%%`'@ \
661 n@8@'`\ls -1 /usr/man/man8 | sed s%\\.8.\*\$%%`'@ \
662 n@9@'`[ -r /usr/man/man9 ] && \ls -1 /usr/man/man9 | sed s%\\.9.\*\$%%`'@ \
663 n@0@'`[ -r /usr/man/man0 ] && \ls -1 /usr/man/man0 | sed s%\\.0.\*\$%%`'@ \
664 n@new@'`[ -r /usr/man/mann ] && \ls -1 /usr/man/mann | sed s%\\.n.\*\$%%`'@ \
665 n@old@'`[ -r /usr/man/mano ] && \ls -1 /usr/man/mano | sed s%\\.o.\*\$%%`'@ \
666 n@local@'`[ -r /usr/man/manl ] && \ls -1 /usr/man/manl | sed s%\\.l.\*\$%%`'@ \
667 n@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
668 c/-/"(- f k M P s t)"/ n/-f/c/ n/-k/x:'<keyword>'/ n/-[MP]/d/ \
669 N@-[MP]@'`\ls -1 $:-1/man? | sed s%\\..\*\$%%`'@ n/*/c/
671 complete ps c/-t/x:'<tty>'/ c/-/"(a c C e g k l S t u v w x)"/ \
672 n/-k/x:'<kernel>'/ N/-k/x:'<core_file>'/ n/*/x:'<PID>'/
673 complete compress c/-/"(c f v b)"/ n/-b/x:'<max_bits>'/ n/*/f:^*.Z/
674 complete uncompress c/-/"(c f v)"/ n/*/f:*.Z/
676 complete uuencode p/1/f/ p/2/x:'<decode_pathname>'/ n/*/n/
677 complete uudecode c/-/"(f)"/ n/-f/f:*.{uu,UU}/ p/1/f:*.{uu,UU}/ n/*/n/
679 complete xhost c/[+-]/\$hosts/ n/*/\$hosts/
681 # these conform to the latest GNU versions available at press time ...
682 # updates by John Gotts <jgotts@engin.umich.edu>
684 complete emacs c/-/"(batch d f funcall i insert kill l load \
685 no-init-file nw q t u user)"/ c/+/x:'<line_number>'/ \
686 n/-d/x:'<display>'/ n/-f/x:'<lisp_function>'/ n/-i/f/ \
687 n@-l@F:$_elispdir@ n/-t/x:'<terminal>'/ \
688 n/-u/u/ n/*/f:^*[\#~]/
690 complete gzcat c/--/"(force help license quiet version)"/ \
691 c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
692 complete gzip c/--/"(stdout to-stdout decompress uncompress \
693 force help list license no-name quiet recurse \
694 suffix test verbose version fast best)"/ \
695 c/-/"(c d f h l L n q r S t v V 1 2 3 4 5 6 7 8 9 -)"/\
696 n/{-S,--suffix}/x:'<file_name_suffix>'/ \
697 n/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
698 N/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
699 n/*/f:^*.{gz,Z,z,zip,taz,tgz}/
700 complete {gunzip,ungzip} c/--/"(stdout to-stdout force help list license \
701 no-name quiet recurse suffix test verbose version)"/ \
702 c/-/"(c f h l L n q r S t v V -)"/ \
703 n/{-S,--suffix}/x:'<file_name_suffix>'/ \
704 n/*/f:*.{gz,Z,z,zip,taz,tgz}/
705 complete zgrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
706 c/-/"(A b B c C e f h i l n s v V w x)"/ \
707 p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
708 n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
709 complete zegrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
710 c/-/"(A b B c C e f h i l n s v V w x)"/ \
711 p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
712 n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
713 complete zfgrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
714 c/-/"(A b B c C e f h i l n s v V w x)"/ \
715 p/1/x:'<fixed_string>'/ N/-*e/f/ \
716 n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
717 complete znew c/-/"(f t v 9 P K)"/ n/*/f:*.Z/
718 complete zmore n/*/f:*.{gz,Z,z,zip}/
719 complete zfile n/*/f:*.{gz,Z,z,zip,taz,tgz}/
720 complete ztouch n/*/f:*.{gz,Z,z,zip,taz,tgz}/
721 complete zforce n/*/f:^*.{gz,tgz}/
723 complete grep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
724 c/--/"(extended-regexp fixed-regexp basic-regexp \
725 regexp file ignore-case word-regexp line-regexp \
726 no-messages revert-match version help byte-offset \
727 line-number with-filename no-filename quiet silent \
728 text directories recursive files-without-match \
729 files-with-matches count before-context after-context \
730 context binary unix-byte-offsets)"/ \
731 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 \
733 p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
734 n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
735 complete egrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
736 c/--/"(extended-regexp fixed-regexp basic-regexp \
737 regexp file ignore-case word-regexp line-regexp \
738 no-messages revert-match version help byte-offset \
739 line-number with-filename no-filename quiet silent \
740 text directories recursive files-without-match \
741 files-with-matches count before-context after-context \
742 context binary unix-byte-offsets)"/ \
743 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 \
745 p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
746 n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
747 complete fgrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
748 c/--/"(extended-regexp fixed-regexp basic-regexp \
749 regexp file ignore-case word-regexp line-regexp \
750 no-messages revert-match version help byte-offset \
751 line-number with-filename no-filename quiet silent \
752 text directories recursive files-without-match \
753 files-with-matches count before-context after-context \
754 context binary unix-byte-offsets)"/ \
755 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 \
757 p/1/x:'<fixed_string>'/ N/-*e/f/ \
758 n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
760 complete users c/--/"(help version)"/ p/1/x:'<accounting_file>'/
761 complete who c/--/"(heading idle count mesg message writable help \
762 version)"/ c/-/"(H i m q s T w u -)"/ \
763 p/1/x:'<accounting_file>'/ n/am/"(i)"/ n/are/"(you)"/
765 complete chown c/--/"(changes dereference no-dereference silent \
766 quiet reference recursive verbose help version)"/ \
767 c/-/"(c f h R v -)"/ C@[./\$~]@f@ c/*[.:]/g/ \
768 n/-/u/: p/1/u/: n/*/f/
769 complete chgrp c/--/"(changes no-dereference silent quiet reference \
770 recursive verbose help version)"/ \
771 c/-/"(c f h R v -)"/ n/-/g/ p/1/g/ n/*/f/
772 complete chmod c/--/"(changes silent quiet verbose reference \
773 recursive help version)"/ c/-/"(c f R v)"/
774 complete df c/--/"(all block-size human-readable si inodes \
775 kilobytes local megabytes no-sync portability sync \
776 type print-type exclude-type help version)"/ \
777 c/-/"(a H h i k l m P T t v x)"/
778 complete du c/--/"(all block-size bytes total dereference-args \
779 human-readable si kilobytes count-links dereference \
780 megabytes separate-dirs summarize one-file-system \
781 exclude-from exclude max-depth help version"/ \
782 c/-/"(a b c D H h k L l m S s X x)"/
784 complete cat c/--/"(number-nonblank number squeeze-blank show-all \
785 show-nonprinting show-ends show-tabs help version)"/ \
786 c/-/"(A b E e n s T t u v -)"/ n/*/f/
787 complete mv c/--/"(backup force interactive update verbose suffix \
788 version-control help version)"/ \
789 c/-/"(b f i S u V v -)"/ \
790 n/{-S,--suffix}/x:'<suffix>'/ \
791 n/{-V,--version-control}/"(t numbered nil existing \
792 never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
793 complete cp c/--/"(archive backup no-dereference force \
794 interactive link preserve parents sparse recursive \
795 symbolic-link suffix update verbose version-control \
796 one-file-system help version)"/ \
797 c/-/"(a b d f i l P p R r S s u V v x -)"/ \
798 n/-*r/d/ n/{-S,--suffix}/x:'<suffix>'/ \
799 n/{-V,--version-control}/"(t numbered nil existing \
800 never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
801 complete ln c/--/"(backup directory force no-dereference \
802 interactive symbolic suffix verbose version-control \
804 c/-/"(b d F f i n S s V v -)"/ \
805 n/{-S,--suffix}/x:'<suffix>'/ \
806 n/{-V,--version-control}/"(t numbered nil existing \
807 never simple)"/ n/-/f/ N/-/x:'<link_name>'/ \
808 p/1/f/ p/2/x:'<link_name>'/
809 complete touch c/--/"(date reference time help version)"/ \
810 c/-/"(a c d f m r t -)"/ \
811 n/{-d,--date}/x:'<date_string>'/ \
812 c/--time/"(access atime mtime modify use)"/ \
813 n/{-r,--file}/f/ n/-t/x:'<time_stamp>'/ n/*/f/
814 complete mkdir c/--/"(mode parents verbose help version)"/ \
816 n/{-m,--mode}/x:'<mode>'/ n/*/d/
817 complete rmdir c/--/"(ignore-fail-on-non-empty parents verbose help \
818 version)"/ c/-/"(p -)"/ n/*/d/
820 complete tar c/-[Acru]*/"(b B C f F g G h i l L M N o P \
821 R S T v V w W X z Z)"/ \
822 c/-[dtx]*/"( B C f F g G i k K m M O p P \
823 R s S T v w x X z Z)"/ \
824 p/1/"(A c d r t u x -A -c -d -r -t -u -x \
825 --catenate --concatenate --create --diff --compare \
826 --delete --append --list --update --extract --get \
827 --help --version)"/ \
828 c/--/"(catenate concatenate create diff compare \
829 delete append list update extract get atime-preserve \
830 block-size read-full-blocks directory checkpoint file \
831 force-local info-script new-volume-script incremental \
832 listed-incremental dereference ignore-zeros \
833 ignore-failed-read keep-old-files starting-file \
834 one-file-system tape-length modification-time \
835 multi-volume after-date newer old-archive portability \
836 to-stdout same-permissions preserve-permissions \
837 absolute-paths preserve record-number remove-files \
838 same-order preserve-order same-owner sparse \
839 files-from null totals verbose label version \
840 interactive confirmation verify exclude exclude-from \
841 compress uncompress gzip ungzip use-compress-program \
842 block-compress help version)"/ \
843 c/-/"(b B C f F g G h i k K l L m M N o O p P R s S \
844 T v V w W X z Z 0 1 2 3 4 5 6 7 -)"/ \
846 n/-c*f/x:'<new_tar_file, device_file, or "-">'/ \
847 n/{-[Adrtux]*f,--file}/f:*.{tar,taz,tgz}/ \
848 N/{-x*f,--file}/'`tar -tf $:-1`'/ \
849 n/--use-compress-program/c/ \
850 n/{-b,--block-size}/x:'<block_size>'/ \
851 n/{-V,--label}/x:'<volume_label>'/ \
852 n/{-N,--{after-date,newer}}/x:'<date>'/ \
853 n/{-L,--tape-length}/x:'<tape_length_in_kB>'/ \
854 n/{-C,--directory}/d/ \
855 N/{-C,--directory}/'`\ls $:-1`'/ \
859 complete mount c/-/"(a F m o O p r v V)"/ n/-p/n/ n/-v/n/ \
860 n/-o/x:'<FSType_options>'/ \
861 n@-F@'`\ls -1 /usr/lib/fs`'@ \
862 n@*@'`grep -v "^#" /etc/vfstab | tr -s " " " " | cut -f 3`'@
863 complete umount c/-/"(a o V)"/ n/-o/x:'<FSType_options>'/ \
864 n/*/'`mount | cut -d " " -f 1`'/
865 complete mountall c/-/"(F l r)"/ n@-F@'`\ls -1 /usr/lib/fs`'@
866 complete umountall c/-/"(F h k l r s)"/ n@-F@'`\ls -1 /usr/lib/fs`'@ \
867 n/-h/'`df -k | cut -s -d ":" -f 1 | sort -u`'/
868 # BSD 4.3 filesystems
869 #complete mount c/-/"(a r t v)"/ n/-t/"(4.2 nfs)"/ \
870 # n@*@'`grep -v "^#" /etc/fstab | tr -s " " " " | cut -f 2`'@
871 #complete umount c/-/"(a h t v)"/ n/-t/"(4.2 nfs)"/ \
872 # n/-h/'`df | cut -s -d ":" -f 1 | sort -u`'/ \
873 # n/*/'`mount | cut -d " " -f 3`'/
874 # BSD 4.2 filesystems
875 #complete mount c/-/"(a r t v)"/ n/-t/"(ufs nfs)"/ \
876 # n@*@'`cut -d ":" -f 2 /etc/fstab`'@
877 #complete umount c/-/"(a h t v)"/ n/-t/"(ufs nfs)"/ \
878 # n/-h/'`df | cut -s -d ":" -f 1 | sort -u`'/ \
879 # n/*/'`mount | cut -d " " -f 3`'/
881 # these deal with NIS (formerly YP); if it's not running you don't need 'em
882 complete domainname p@1@D:$_ypdir@" " n@*@n@
883 complete ypcat c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
884 N@-d@\`\\ls\ -1\ $_ypdir/\$:-1\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
885 n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
886 complete ypmatch c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
887 N@-d@x:'<key ...>'@ n@-@x:'<key ...>'@ p@1@x:'<key ...>'@ \
888 n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
889 complete ypwhich c@-@"(d m t x V1 V2)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
890 n@-m@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
893 # there's no need to clutter the user's shell with these
894 unset _elispdir _maildir _ypdir _domain
899 'n@*@`cat -s GNUmakefile Makefile makefile |& sed -n -e "/No such file/d" -e "/^[^ #].*:/s/:.*//p"`@'
901 if ( -f /etc/printcap ) then
902 set printers=(`sed -n -e "/^[^ #].*:/s/:.*//p" /etc/printcap`)
904 complete lpr 'c/-P/$printers/'
905 complete lpq 'c/-P/$printers/'
906 complete lprm 'c/-P/$printers/'
907 complete lpquota 'p/1/(-Qprlogger)/' 'c/-P/$printers/'
908 complete dvips 'c/-P/$printers/' 'n/-o/f:*.{ps,PS}/' 'n/*/f:*.dvi/'
909 complete dvilj 'p/*/f:*.dvi/'