PageRenderTime 30ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/contrib/tcsh/complete.tcsh

https://bitbucket.org/freebsd/freebsd-head/
C Shell | 1228 lines | 1084 code | 91 blank | 53 comment | 50 complexity | a3a411c27bb6a1b41bdbb93d9e05cbf9 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, BSD-3-Clause, LGPL-2.0, LGPL-2.1, BSD-2-Clause, 0BSD, JSON, AGPL-1.0, GPL-2.0
  1. #
  2. # $tcsh: complete.tcsh,v 1.52 2010/05/07 17:54:13 christos Exp $
  3. # example file using the new completion code
  4. #
  5. # Debian GNU/Linux
  6. # /usr/share/doc/tcsh/examples/complete.gz
  7. #
  8. # This file may be read from user's ~/.cshrc or ~/.tcshrc file by
  9. # decompressing it into the home directory as ~/.complete and
  10. # then adding the line "source ~/.complete" and maybe defining
  11. # some of the shell variables described below.
  12. #
  13. # Added two Debian-specific completions: dpkg and dpkg-deb (who
  14. # wrote them?). Changed completions of several commands. The ones
  15. # are evaluated if the `traditional_complete' shell variable is
  16. # defined.
  17. #
  18. # Debian enhancements by Vadim Vygonets <vadik@cs.huji.ac.il>.
  19. # Bugfixes and apt completions by Miklos Quartus <miklos.quartus@nokia.com>.
  20. # Cleanup by Martin A. Godisch <martin@godisch.de>.
  21. onintr -
  22. if (! $?prompt) goto end
  23. if ($?tcsh) then
  24. if ($tcsh != 1) then
  25. set rev=$tcsh:r
  26. set rel=$rev:e
  27. set pat=$tcsh:e
  28. set rev=$rev:r
  29. endif
  30. if ($rev > 5 && $rel > 1) then
  31. set _complete=1
  32. endif
  33. unset rev rel pat
  34. endif
  35. if ($?_complete) then
  36. set noglob
  37. if ( ! $?hosts ) set hosts
  38. foreach f ("$HOME/.hosts" /usr/local/etc/csh.hosts "$HOME/.rhosts" /etc/hosts.equiv)
  39. if ( -r "$f" ) then
  40. set hosts = ($hosts `grep -v "+" "$f" | grep -E -v "^#" | tr -s " " " " | cut -f 1`)
  41. endif
  42. end
  43. if ( -r "$HOME/.netrc" ) then
  44. set f=`awk '/machine/ { print $2 }' < "$HOME/.netrc"` >& /dev/null
  45. set hosts=($hosts $f)
  46. endif
  47. if ( -r "$HOME/.ssh/known_hosts" ) then
  48. set f=`cat "$HOME/.ssh/known_hosts" | cut -f 1 -d \ ` >& /dev/null
  49. set f=`cat "$HOME/.ssh/known_hosts" | cut -f 1 -d \ | sed -e 's/,/ /g'` >& /dev/null
  50. set hosts=($hosts $f)
  51. endif
  52. unset f
  53. if ( ! $?hosts ) then
  54. set hosts=(hyperion.ee.cornell.edu phaeton.ee.cornell.edu \
  55. guillemin.ee.cornell.edu vangogh.cs.berkeley.edu \
  56. ftp.uu.net prep.ai.mit.edu export.lcs.mit.edu \
  57. labrea.stanford.edu sumex-aim.stanford.edu \
  58. tut.cis.ohio-state.edu)
  59. endif
  60. complete ywho n/*/\$hosts/ # argument from list in $hosts
  61. complete rsh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
  62. complete ssh p/1/\$hosts/ c/-/"(l n)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
  63. complete xrsh p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/
  64. complete rlogin p/1/\$hosts/ c/-/"(l 8 e)"/ n/-l/u/
  65. complete telnet p/1/\$hosts/ p/2/x:'<port>'/ n/*/n/
  66. complete cd p/1/d/ # Directories only
  67. complete chdir p/1/d/
  68. complete pushd p/1/d/
  69. complete popd p/1/d/
  70. complete pu p/1/d/
  71. complete po p/1/d/
  72. complete complete p/1/X/ # Completions only
  73. complete uncomplete n/*/X/
  74. complete exec p/1/c/ # Commands only
  75. complete trace p/1/c/
  76. complete strace p/1/c/
  77. complete which n/*/c/
  78. complete where n/*/c/
  79. complete skill p/1/c/
  80. complete dde p/1/c/
  81. complete adb c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
  82. complete sdb p/1/c/
  83. complete dbx c/-I/d/ n/-/c/ N/-/"(core)"/ p/1/c/ p/2/"(core)"/
  84. complete xdb p/1/c/
  85. complete gdb n/-d/d/ n/*/c/
  86. complete ups p/1/c/
  87. complete set 'c/*=/f/' 'p/1/s/=' 'n/=/f/'
  88. complete unset n/*/s/
  89. complete alias p/1/a/ # only aliases are valid
  90. complete unalias n/*/a/
  91. complete xdvi n/*/f:*.dvi/ # Only files that match *.dvi
  92. complete dvips n/*/f:*.dvi/
  93. if ($?traditional_complete) then
  94. complete tex n/*/f:*.tex/ # Only files that match *.tex
  95. else
  96. complete tex n/*/f:*.{tex,texi}/ # Files that match *.tex and *.texi
  97. endif
  98. complete latex n/*/f:*.{tex,ltx}/
  99. complete su c/--/"(login fast preserve-environment command shell \
  100. help version)"/ c/-/"(f l m p c s -)"/ \
  101. n/{-c,--command}/c/ \
  102. n@{-s,--shell}@'`cat /etc/shells`'@ n/*/u/
  103. complete cc c/-[IL]/d/ \
  104. c@-l@'`\ls -1 /usr/lib/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
  105. c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
  106. complete acc c/-[IL]/d/ \
  107. c@-l@'`\ls -1 /usr/lang/SC1.0/lib*.a | sed s%^.\*/lib%%\;s%\\.a\$%%`'@ \
  108. c/-/"(o l c g L I D U)"/ n/*/f:*.[coasi]/
  109. complete gcc c/-[IL]/d/ \
  110. c/-f/"(caller-saves cse-follow-jumps delayed-branch \
  111. elide-constructors expensive-optimizations \
  112. float-store force-addr force-mem inline \
  113. inline-functions keep-inline-functions \
  114. memoize-lookups no-default-inline \
  115. no-defer-pop no-function-cse omit-frame-pointer \
  116. rerun-cse-after-loop schedule-insns \
  117. schedule-insns2 strength-reduce \
  118. thread-jumps unroll-all-loops \
  119. unroll-loops syntax-only all-virtual \
  120. cond-mismatch dollars-in-identifiers \
  121. enum-int-equiv no-asm no-builtin \
  122. no-strict-prototype signed-bitfields \
  123. signed-char this-is-variable unsigned-bitfields \
  124. unsigned-char writable-strings call-saved-reg \
  125. call-used-reg fixed-reg no-common \
  126. no-gnu-binutils nonnull-objects \
  127. pcc-struct-return pic PIC shared-data \
  128. short-enums short-double volatile)"/ \
  129. c/-W/"(all aggregate-return cast-align cast-qual \
  130. comment conversion enum-clash error format \
  131. id-clash-len implicit missing-prototypes \
  132. no-parentheses pointer-arith return-type shadow \
  133. strict-prototypes switch uninitialized unused \
  134. write-strings)"/ \
  135. c/-m/"(68000 68020 68881 bitfield fpa nobitfield rtd \
  136. short c68000 c68020 soft-float g gnu unix fpu \
  137. no-epilogue)"/ \
  138. c/-d/"(D M N)"/ \
  139. c/-/"(f W vspec v vpath ansi traditional \
  140. traditional-cpp trigraphs pedantic x o l c g L \
  141. I D U O O2 C E H B b V M MD MM i dynamic \
  142. nodtdlib static nostdinc undef)"/ \
  143. c/-l/f:*.a/ \
  144. n/*/f:*.{c,C,cc,o,a,s,i}/
  145. complete g++ n/*/f:*.{C,cc,o,s,i}/
  146. complete CC n/*/f:*.{C,cc,cpp,o,s,i}/
  147. complete rm c/--/"(directory force interactive verbose \
  148. recursive help version)"/ c/-/"(d f i v r R -)"/ \
  149. n/*/f:^*.{c,cc,C,h,in}/ # Protect precious files
  150. complete vi n/*/f:^*.[oa]/
  151. complete bindkey N/-a/b/ N/-c/c/ n/-[ascr]/'x:<key-sequence>'/ \
  152. n/-[svedlr]/n/ c/-[vedl]/n/ c/-/"(a s k c v e d l r)"/\
  153. n/-k/"(left right up down)"/ p/2-/b/ \
  154. p/1/'x:<key-sequence or option>'/
  155. complete find n/-fstype/"(nfs 4.2)"/ n/-name/f/ \
  156. n/-type/"(c b d f p l s)"/ n/-user/u/ n/-group/g/ \
  157. n/-exec/c/ n/-ok/c/ n/-cpio/f/ n/-ncpio/f/ n/-newer/f/ \
  158. c/-/"(fstype name perm prune type user nouser \
  159. group nogroup size inum atime mtime ctime exec \
  160. ok print ls cpio ncpio newer xdev depth \
  161. daystart follow maxdepth mindepth noleaf version \
  162. anewer cnewer amin cmin mmin true false uid gid \
  163. ilname iname ipath iregex links lname empty path \
  164. regex used xtype fprint fprint0 fprintf \
  165. print0 printf not a and o or)"/ \
  166. n/*/d/
  167. complete -%* c/%/j/ # fill in the jobs builtin
  168. complete {fg,bg,stop} c/%/j/ p/1/"(%)"//
  169. complete limit c/-/"(h)"/ n/*/l/
  170. complete unlimit c/-/"(h)"/ n/*/l/
  171. complete -co* p/0/"(compress)"/ # make compress completion
  172. # not ambiguous
  173. if ($?traditional_complete) then
  174. complete zcat n/*/f:*.Z/
  175. else
  176. # "zcat" may be linked to "compress" or "gzip"
  177. if (-X zcat) then
  178. zcat --version >& /dev/null
  179. if ($status != 0) then
  180. complete zcat n/*/f:*.Z/
  181. else
  182. complete zcat c/--/"(force help license quiet version)"/ \
  183. c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
  184. endif
  185. endif
  186. endif
  187. complete finger c/*@/\$hosts/ n/*/u/@
  188. complete ping p/1/\$hosts/
  189. complete traceroute p/1/\$hosts/
  190. complete {talk,ntalk,phone} p/1/'`users | tr " " "\012" | uniq`'/ \
  191. n/*/\`who\ \|\ grep\ \$:1\ \|\ awk\ \'\{\ print\ \$2\ \}\'\`/
  192. complete ftp c/-/"(d i g n v)"/ n/-/\$hosts/ p/1/\$hosts/ n/*/n/
  193. # this one is simple...
  194. #complete rcp c/*:/f/ C@[./\$~]*@f@ n/*/\$hosts/:
  195. # From Michael Schroeder <mlschroe@immd4.informatik.uni-erlangen.de>
  196. # This one will rsh to the file to fetch the list of files!
  197. 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/:'
  198. complete dd c/--/"(help version)"/ c/[io]f=/f/ \
  199. c/conv=*,/"(ascii ebcdic ibm block unblock \
  200. lcase notrunc ucase swab noerror sync)"/,\
  201. c/conv=/"(ascii ebcdic ibm block unblock \
  202. lcase notrunc ucase swab noerror sync)"/,\
  203. c/*=/x:'<number>'/ \
  204. n/*/"(if of conv ibs obs bs cbs files skip file seek count)"/=
  205. complete nslookup p/1/x:'<host>'/ p/2/\$hosts/
  206. complete ar c/[dmpqrtx]/"(c l o u v a b i)"/ p/1/"(d m p q r t x)"// \
  207. p/2/f:*.a/ p/*/f:*.o/
  208. # these should be merged with the MH completion hacks below - jgotts
  209. complete {refile,sprev,snext,scan,pick,rmm,inc,folder,show} \
  210. "c@+@F:$HOME/Mail/@"
  211. # these and interrupt handling from Jaap Vermeulen <jaap@sequent.com>
  212. complete {rexec,rxexec,rxterm,rmterm} \
  213. 'p/1/$hosts/' 'c/-/(l L E)/' 'n/-l/u/' 'n/-L/f/' \
  214. 'n/-E/e/' 'n/*/c/'
  215. complete kill 'c/-/S/' 'c/%/j/' \
  216. 'n/*/`ps -u $LOGNAME | awk '"'"'{print $1}'"'"'`/'
  217. # these from Marc Horowitz <marc@cam.ov.com>
  218. complete attach 'n/-mountpoint/d/' 'n/-m/d/' 'n/-type/(afs nfs rvd ufs)/' \
  219. 'n/-t/(afs nfs rvd ufs)/' 'n/-user/u/' 'n/-U/u/' \
  220. 'c/-/(verbose quiet force printpath lookup debug map \
  221. nomap remap zephyr nozephyr readonly write \
  222. mountpoint noexplicit explicit type mountoptions \
  223. nosetuid setuid override skipfsck lock user host)/' \
  224. 'n/-e/f/' 'n/*/()/'
  225. complete hesinfo 'p/1/u/' \
  226. 'p/2/(passwd group uid grplist pcap pobox cluster \
  227. filsys sloc service)/'
  228. # these from E. Jay Berkenbilt <ejb@ERA.COM>
  229. # = isn't always followed by a filename or a path anymore - jgotts
  230. if ($?traditional_complete) then
  231. complete ./configure \
  232. 'c/--*=/f/' 'c/--{cache-file,prefix,exec-prefix,\
  233. bindir,sbindir,libexecdir,datadir,\
  234. sysconfdir,sharedstatedir,localstatedir,\
  235. libdir,includedir,oldincludedir,infodir,\
  236. mandir,srcdir}/(=)//' \
  237. 'c/--/(cache-file verbose prefix exec-prefix bindir \
  238. sbindir libexecdir datadir sysconfdir \
  239. sharedstatedir localstatedir libdir \
  240. includedir oldincludedir infodir mandir \
  241. srcdir)//'
  242. else
  243. complete ./configure \
  244. 'c@--{prefix,exec-prefix,bindir,sbindir,libexecdir,datadir,sysconfdir,sharedstatedir,localstatedir,infodir,mandir,srcdir,x-includes,x-libraries}=*@x:<directory e.g. /usr/local>'@ \
  245. 'c/--cachefile=*/x:<filename>/' \
  246. 'c/--{enable,disable,with}-*/x:<feature>//' \
  247. 'c/--*=/x:<directory>//' \
  248. 'c/--/(prefix= exec-prefix= bindir= \
  249. sbindir= libexecdir= datadir= sysconfdir= \
  250. sharedstatedir= localstatedir= infodir= \
  251. mandir= srcdir= x-includes= x-libraries= cachefile= \
  252. enable- disable- with- \
  253. help no-create quiet silent version verbose )//'
  254. endif
  255. complete gs 'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc \
  256. dfaxhigh dfaxlow laserjet ljet4 sparc pbm \
  257. pbmraw pgm pgmraw ppm ppmraw bit)/' \
  258. 'c/-sOutputFile=/f/' 'c/-s/(DEVICE OutputFile)/=' \
  259. 'c/-d/(NODISPLAY NOPLATFONTS NOPAUSE)/' 'n/*/f/'
  260. complete perl 'n/-S/c/'
  261. complete printenv 'n/*/e/'
  262. complete sccs p/1/"(admin cdc check clean comb deledit delget \
  263. delta diffs edit enter fix get help info \
  264. print prs prt rmdel sccsdiff tell unedit \
  265. unget val what)"/
  266. complete setenv 'p/1/e/' 'c/*:/f/'
  267. # these and method of setting hosts from Kimmo Suominen <kim@tac.nyc.ny.us>
  268. if ( -f "$HOME/.mh_profile" && -x "`which folders`" ) then
  269. if ( ! $?FOLDERS ) setenv FOLDERS "`folders -fast -recurse`"
  270. if ( ! $?MHA ) setenv MHA "`ali | sed -e '/^ /d' -e 's/:.*//'`"
  271. set folders = ( $FOLDERS )
  272. set mha = ( $MHA )
  273. complete ali \
  274. 'c/-/(alias nolist list nonormalize normalize nouser user help)/' \
  275. 'n,-alias,f,'
  276. complete anno \
  277. 'c/-/(component noinplace inplace nodate date text help)/' \
  278. 'c,+,$folders,' \
  279. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  280. complete burst \
  281. 'c/-/(noinplace inplace noquiet quiet noverbose verbose help)/' \
  282. 'c,+,$folders,' \
  283. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  284. complete comp \
  285. 'c/-/(draftfolder draftmessage nodraftfolder editor noedit file form nouse use whatnowproc nowhatnowproc help)/' \
  286. 'c,+,$folders,' \
  287. 'n,-whatnowproc,c,' \
  288. 'n,-file,f,'\
  289. 'n,-form,f,'\
  290. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  291. complete dist \
  292. 'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit form noinplace inplace whatnowproc nowhatnowproc help)/' \
  293. 'c,+,$folders,' \
  294. 'n,-whatnowproc,c,' \
  295. 'n,-form,f,'\
  296. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  297. complete folder \
  298. 'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
  299. 'c,+,$folders,' \
  300. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  301. complete folders \
  302. 'c/-/(all nofast fast noheader header nopack pack noverbose verbose norecurse recurse nototal total noprint print nolist list push pop help)/' \
  303. 'c,+,$folders,' \
  304. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  305. complete forw \
  306. 'c/-/(noannotate annotate draftfolder draftmessage nodraftfolder editor noedit filter form noformat format noinplace inplace digest issue volume whatnowproc nowhatnowproc help)/' \
  307. 'c,+,$folders,' \
  308. 'n,-whatnowproc,c,' \
  309. 'n,-filter,f,'\
  310. 'n,-form,f,'\
  311. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  312. complete inc \
  313. 'c/-/(audit file noaudit nochangecur changecur file form format nosilent silent notruncate truncate width help)/' \
  314. 'c,+,$folders,' \
  315. 'n,-audit,f,'\
  316. 'n,-form,f,'
  317. complete mark \
  318. 'c/-/(add delete list sequence nopublic public nozero zero help)/' \
  319. 'c,+,$folders,' \
  320. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  321. complete mhmail \
  322. 'c/-/(body cc from subject help)/' \
  323. 'n,-cc,$mha,' \
  324. 'n,-from,$mha,' \
  325. 'n/*/$mha/'
  326. complete mhpath \
  327. 'c/-/(help)/' \
  328. 'c,+,$folders,' \
  329. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  330. complete msgchk \
  331. 'c/-/(nodate date nonotify notify help)/'
  332. complete msh \
  333. 'c/-/(prompt noscan scan notopcur topcur help)/'
  334. complete next \
  335. 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
  336. 'c,+,$folders,' \
  337. 'n,-moreproc,c,' \
  338. 'n,-showproc,c,' \
  339. 'n,-form,f,'
  340. complete packf \
  341. 'c/-/(file help)/' \
  342. 'c,+,$folders,' \
  343. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  344. complete pick \
  345. 'c/-/(and or not lbrace rbrace cc date from search subject to othercomponent after before datefield sequence nopublic public nozero zero nolist list help)/' \
  346. 'c,+,$folders,' \
  347. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  348. complete prev \
  349. 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
  350. 'c,+,$folders,' \
  351. 'n,-moreproc,c,' \
  352. 'n,-showproc,c,' \
  353. 'n,-form,f,'
  354. complete prompter \
  355. 'c/-/(erase kill noprepend prepend norapid rapid nodoteof doteof help)/'
  356. complete refile \
  357. 'c/-/(draft nolink link nopreserve preserve src file help)/' \
  358. 'c,+,$folders,' \
  359. 'n,-file,f,'\
  360. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  361. complete rmf \
  362. 'c/-/(nointeractive interactive help)/' \
  363. 'c,+,$folders,'
  364. complete rmm \
  365. 'c/-/(help)/' \
  366. 'c,+,$folders,' \
  367. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  368. complete scan \
  369. 'c/-/(noclear clear form format noheader header width noreverse reverse file help)/' \
  370. 'c,+,$folders,' \
  371. 'n,-form,f,'\
  372. 'n,-file,f,'\
  373. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  374. complete send \
  375. 'c/-/(alias draft draftfolder draftmessage nodraftfolder filter nofilter noformat format noforward forward nomsgid msgid nopush push noverbose verbose nowatch watch width help)/' \
  376. 'n,-alias,f,'\
  377. 'n,-filter,f,'
  378. complete show \
  379. 'c/-/(draft form moreproc nomoreproc length width showproc noshowproc header noheader help)/' \
  380. 'c,+,$folders,' \
  381. 'n,-moreproc,c,' \
  382. 'n,-showproc,c,' \
  383. 'n,-form,f,'\
  384. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  385. complete sortm \
  386. 'c/-/(datefield textfield notextfield limit nolimit noverbose verbose help)/' \
  387. 'c,+,$folders,' \
  388. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  389. complete vmh \
  390. 'c/-/(prompt vmhproc novmhproc help)/' \
  391. 'n,-vmhproc,c,'
  392. complete whatnow \
  393. 'c/-/(draftfolder draftmessage nodraftfolder editor noedit prompt help)/'
  394. complete whom \
  395. 'c/-/(alias nocheck check draft draftfolder draftmessage nodraftfolder help)/' \
  396. 'n,-alias,f,'
  397. complete plum \
  398. 'c/-/()/' \
  399. 'c,+,$folders,' \
  400. 'n,*,`(mark | sed "s/:.*//";echo next cur prev first last)|tr " " "\12" | sort -u`,'
  401. complete mail \
  402. 'c/-/()/' \
  403. 'n/*/$mha/'
  404. endif
  405. #from Dan Nicolaescu <dann@ics.uci.edu>
  406. if ( $?MODULESHOME ) then
  407. alias Compl_module 'find ${MODULEPATH:as/:/ /} -name .version -o -name .modulea\* -prune -o -print | sed `echo "-e s@${MODULEPATH:as%:%/\*@@g -e s@%}/\*@@g"`'
  408. complete module 'p%1%(add load unload switch display avail use unuse update purge list clear help initadd initrm initswitch initlist initclear)%' \
  409. 'n%{unl*,sw*,inits*}%`echo "$LOADEDMODULES:as/:/ /"`%' \
  410. 'n%{lo*,di*,he*,inita*,initr*}%`eval Compl_module`%' \
  411. 'N%{sw*,initsw*}%`eval Compl_module`%' 'C%-%(-append)%' 'n%{use,unu*,av*}%d%' 'n%-append%d%' \
  412. 'C%[^-]*%`eval Compl_module`%'
  413. endif
  414. # from George Cox
  415. complete acroread 'p/*/f:*.{pdf,PDF}/'
  416. complete apachectl 'c/*/(start stop restart fullstatus status graceful \
  417. configtest help)/'
  418. complete appletviewer 'p/*/f:*.class/'
  419. complete bison 'c/--/(debug defines file-prefix= fixed-output-files \
  420. help name-prefix= no-lines no-parser output= \
  421. token-table verbose version yacc)/' \
  422. 'c/-/(b d h k l n o p t v y V)/' 'n/-b/f/' 'n/-o/f/' \
  423. 'n/-p/f/'
  424. complete bzcat c/--/"(help test quiet verbose license version)"/ \
  425. c/-/"(h t L V -)"/ n/*/f:*.{bz2,tbz}/
  426. complete bunzip2 c/--/"(help keep force test stdout quiet verbose \
  427. license version)"/ c/-/"(h k f t c q v L V -)"/ \
  428. n/*/f:*.{bz2,tbz}/
  429. complete bzip2 c/--/"(help decompress compress keep force test \
  430. stdout quiet verbose license version small)"/ \
  431. c/-/"(h d z k f t c q v L V s 1 2 3 4 5 6 7 8 9 -)"/ \
  432. n/{-d,--decompress}/f:*.{bz2,tbz}/ \
  433. N/{-d,--decompress}/f:*.{bz2,tbz}/ n/*/f:^*.{bz2,tbz}/
  434. complete c++ 'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
  435. complete co 'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
  436. complete crontab 'n/-u/u/'
  437. complete camcontrol 'p/1/(cmd debug defects devlist eject inquiry \
  438. modepage negotiate periphlist rescan reset start \
  439. stop tags tur)/'
  440. complete ctlinnd 'p/1/(addhist allow begin cancel changegroup \
  441. checkfile drop feedinfo flush flushlogs go hangup \
  442. logmode mode name newgroup param pause readers refile \
  443. reject reload renumber reserve rmgroup send shutdown \
  444. kill throttle trace xabort xexec)/'
  445. complete cvs 'c/--/(help help-commands help-synonyms)/' \
  446. 'p/1/(add admin annotate checkout commit diff \
  447. edit editors export history import init log login \
  448. logout rdiff release remove rtag status tag unedit \
  449. update watch watchers)/' 'n/-a/(edit unedit commit \
  450. all none)/' 'n/watch/(on off add remove)/'
  451. complete svn 'C@file:///@`'"${HOME}/etc/tcsh/complete.d/svn"'`@@' \
  452. 'n@ls@(file:/// svn+ssh:// svn://)@@' \
  453. 'n@help@(add blame cat checkout \
  454. cleanup commit copy delete export help \
  455. import info list ls lock log merge mkdir \
  456. move propdel propedit propget proplist \
  457. propset resolved revert status switch unlock \
  458. update)@' 'p@1@(add blame cat checkout \
  459. cleanup commit copy delete export help \
  460. import info list ls lock log merge mkdir \
  461. move propdel propedit propget proplist \
  462. propset resolved revert status switch unlock \
  463. update)@'
  464. complete cxx 'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
  465. complete detex 'p/*/f:*.tex/'
  466. complete edquota 'n/*/u/'
  467. complete exec 'p/1/c/'
  468. complete ghostview 'p/*/f:*.ps/'
  469. complete gv 'p/*/f:*.ps/'
  470. complete ifconfig 'p@1@`ifconfig -l`@' 'n/*/(range phase link netmask \
  471. mtu vlandev vlan metric mediaopt down delete \
  472. broadcast arp debug)/'
  473. complete imake 'c/-I/d/'
  474. complete ipfw 'p/1/(flush add delete list show zero)/' \
  475. 'n/add/(allow permit accept pass deny drop reject \
  476. reset count skipto num divert port tee port)/'
  477. complete javac 'p/*/f:*.java/'
  478. complete ldif2ldbm 'n/-i/f:*.ldif/'
  479. complete libtool 'c/--mode=/(compile execute finish install link \
  480. uninstall)/' 'c/--/(config debug dry-run features \
  481. finish help quiet silent version mode=)/'
  482. complete libtoolize 'c/--/(automake copy debug dry-run force help ltdl \
  483. ltdl-tar version)/'
  484. complete links 'c/-/(assume-codepage async-dns download-dir \
  485. format-cache-size ftp-proxy help http-proxy \
  486. max-connections max-connections-to-host \
  487. memory-cache-size receive-timeout retries \
  488. unrestartable-receive-timeout version)/'
  489. complete natd c/-/'(alias_address config deny_incoming dynamic \
  490. inport interface log log_denied log_facility \
  491. outport outport port pptpalias proxy_only \
  492. proxy_rule redirect_address redirect_port \
  493. reverse same_ports unregistered_only use_sockets \
  494. verbose)'/ 'n@-interface@`ifconfig -l`@'
  495. complete netstat 'n@-I@`ifconfig -l`@'
  496. complete objdump 'c/--/(adjust-vma= all-headers architecture= \
  497. archive-headers debugging demangle disassemble \
  498. disassemble-all disassemble-zeroes dynamic-reloc \
  499. dynamic-syms endian= file-headers full-contents \
  500. headers help info line-numbers no-show-raw-insn \
  501. prefix-addresses private-headers reloc section-headers \
  502. section=source stabs start-address= stop-address= \
  503. syms target= version wide)/' \
  504. 'c/-/(a h i f C d D p r R t T x s S l w)/'
  505. complete xmodmap 'c/-/(display help grammar verbose quiet n e pm pk \
  506. pke pp)/'
  507. complete lynx 'c/-/(accept_all_cookies anonymous assume_charset= \
  508. assume_local_charset= assume_unrec_charset= auth= base \
  509. book buried_news cache= case cfg= child cookie_file= \
  510. cookies core crawl debug_partial display= dump editor= \
  511. emacskeys enable_scrollback error_file= force_html \
  512. force_secure forms_options from ftp get_data head help \
  513. hiddenlinks= historical homepage= image_links index= \
  514. ismap link= localhost mime_header minimal \
  515. newschunksize= newsmaxchunk= nobrowse nocc nocolor \
  516. nofilereferer nolist nolog nopause noprint noredir \
  517. noreferer nostatus number_links partial partial_thres \
  518. pauth= popup post_data preparsed print pseudo_inlines \
  519. raw realm reload restrictions= resubmit_posts rlogin \
  520. selective show_cursor soft_dquotes source stack_dump \
  521. startfile_ok tagsoup telnet term= tlog trace traversal \
  522. underscore useragent= validate verbose version vikeys \
  523. width=)/' 'c/(http|ftp)/$URLS/'
  524. complete gmake 'c/{--directory=,--include-dir=}/d/' \
  525. 'c/{--assume-new,--assume-old,--makefile,--new-file,--what-if,--file}/f/' \
  526. 'c/--/(assume-new= assume-old= debug directory= \
  527. dry-run environment-overrides file= help \
  528. ignore-errors include-dir= jobs[=N] just-print \
  529. keep-going load-average[=N] makefile= max-load[=N] \
  530. new-file= no-builtin-rules no-keep-going \
  531. no-print-directory old-file= print-data-base \
  532. print-directory question quiet recon silent stop \
  533. touch version warn-undefined-variables what-if=)/' \
  534. 'n@*@`cat -s GNUMakefile Makefile makefile |& sed -n -e "/No such file/d" -e "s/^\([A-Za-z0-9-]*\):.*/\1/p"`@' \
  535. 'n/=/f/' 'n/-f/f/'
  536. complete mixer p/1/'(vol bass treble synth pcm speaker mic cd mix \
  537. pcm2 rec igain ogain line1 line2 line3)'/ \
  538. p@2@'`mixer $:-1 | awk \{\ print\ \$7\ \}`'@
  539. complete mpg123 'c/--/(2to1 4to1 8bit aggressive au audiodevice \
  540. auth buffer cdr check doublespeed equalizer frames \
  541. gain halfspeed headphones left lineout list mix mono \
  542. proxy quiet random rate reopen resync right scale \
  543. shuffle single0 single1 skip speaker stdout stereo \
  544. test verbose wav)/'
  545. complete mysqladmin 'n/*/(create drop extended-status flush-hosts \
  546. flush-logs flush-status flush-tables flush-privileges \
  547. kill password ping processlist reload refresh \
  548. shutdown status variables version)/'
  549. complete mutt "c@-f=@F:${HOME}/Mail/@" \
  550. n/-a/f/ \
  551. n/-F/f/ n/-H/f/ \
  552. n/-s/x:'<subject line>'/ \
  553. n/-e/x:'<command>'/ \
  554. n@-b@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@ \
  555. n@-c@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@ \
  556. n@*@'`cat "${HOME}/.muttrc-alias" | awk '"'"'{print $2 }'"'"\`@
  557. complete ndc 'n/*/(status dumpdb reload stats trace notrace \
  558. querylog start stop restart )/'
  559. if ($?traditional_complete) then
  560. complete nm \
  561. 'c/--/(debug-syms defined-only demangle dynamic \
  562. extern-only format= help line-numbers no-demangle \
  563. no-sort numeric-sort portability print-armap \
  564. print-file-name reverse-sort size-sort undefined-only \
  565. version)/' 'p/*/f:^*.{h,C,c,cc}/'
  566. else
  567. complete nm \
  568. 'c/--radix=/x:<radix: _o_ctal _d_ecimal he_x_adecimal>/' \
  569. 'c/--target=/x:<bfdname>/' \
  570. 'c/--format=/(bsd sysv posix)/n/' \
  571. 'c/--/(debugsyms extern-only demangle dynamic print-armap \
  572. print-file-name numeric-sort no-sort reverse-sort \
  573. size-sort undefined-only portability target= radix= \
  574. format= defined-only\ line-numbers no-demangle version \
  575. help)//' \
  576. 'n/*/f:^*.{h,c,cc,s,S}/'
  577. endif
  578. complete nmap 'n@-e@`ifconfig -l`@' 'p/*/$hostnames/'
  579. complete perldoc 'n@*@`\ls -1 /usr/libdata/perl/5.*/pod | sed s%\\.pod.\*\$%%`@'
  580. complete postfix 'n/*/(start stop reload abort flush check)/'
  581. complete postmap 'n/1/(hash: regexp:)/' 'c/hash:/f/' 'c/regexp:/f/'
  582. complete rcsdiff 'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
  583. complete X 'c/-/(I a ac allowMouseOpenFail allowNonLocalModInDev \
  584. allowNonLocalXvidtune ar1 ar2 audit auth bestRefresh \
  585. bgamma bpp broadcast bs c cc class co core deferglyphs \
  586. disableModInDev disableVidMode displayID dpi dpms f fc \
  587. flipPixels fn fp gamma ggamma help indirect kb keeptty \
  588. ld lf logo ls nolisten string noloadxkb nolock nopn \
  589. once p pn port probeonly query quiet r rgamma s \
  590. showconfig sp su t terminate to tst v verbose version \
  591. weight wm x xkbdb xkbmap)/'
  592. complete users 'c/--/(help version)/' 'p/1/x:"<accounting_file>"/'
  593. complete vidcontrol 'p/1/(132x25 132x30 132x43 132x50 132x60 40x25 80x25 \
  594. 80x30 80x43 80x50 80x60 EGA_80x25 EGA_80x43 \
  595. VESA_132x25 VESA_132x30 VESA_132x43 VESA_132x50 \
  596. VESA_132x60 VESA_800x600 VGA_320x200 VGA_40x25 \
  597. VGA_80x25 VGA_80x30 VGA_80x50 VGA_80x60)/'
  598. complete vim 'n/*/f:^*.[oa]/'
  599. complete where 'n/*/c/'
  600. complete which 'n/*/c/'
  601. complete wmsetbg 'c/-/(display D S a b c d e m p s t u w)/' \
  602. 'c/--/(back-color center colors dither help match \
  603. maxscale parse scale smooth tile update-domain \
  604. update-wmaker version workspace)/'
  605. complete xdb 'p/1/c/'
  606. complete xdvi 'c/-/(allowshell debug display expert gamma hushchars \
  607. hushchecksums hushspecials install interpreter keep \
  608. margins nogrey noinstall nomakepk noscan paper safer \
  609. shrinkbuttonn thorough topmargin underlink version)/' \
  610. 'n/-paper/(a4 a4r a5 a5r)/' 'p/*/f:*.dvi/'
  611. complete xlock 'c/-/(allowaccess allowroot debug description \
  612. echokeys enablesaver grabmouse grabserver hide inroot \
  613. install inwindow mono mousemotion nolock remote \
  614. resetsaver sound timeelapsed use3d usefirst verbose \
  615. wireframe background batchcount bg bitmap both3d \
  616. count cycles delay delta3d display dpmsoff \
  617. dpmsstandby dpmssuspend endCmd erasedelay erasemode \
  618. erasetime fg font foreground geometry help \
  619. icongeometry info invalid left3d lockdelay logoutCmd \
  620. mailCmd mailIcon message messagefile messagefont \
  621. messagesfile mode name ncolors nice nomailIcon none3d \
  622. parent password planfont program resources right3d \
  623. saturation size startCmd timeout username validate \
  624. version visual)/' 'n/-mode/(ant atlantis ball bat \
  625. blot bouboule bounce braid bubble bubble3d bug cage \
  626. cartoon clock coral crystal daisy dclock decay deco \
  627. demon dilemma discrete drift eyes fadeplot flag flame \
  628. flow forest galaxy gears goop grav helix hop hyper \
  629. ico ifs image invert julia kaleid kumppa lament laser \
  630. life life1d life3d lightning lisa lissie loop lyapunov \
  631. mandelbrot marquee matrix maze moebius morph3d \
  632. mountain munch nose pacman penrose petal pipes puzzle \
  633. pyro qix roll rotor rubik shape sierpinski slip sphere \
  634. spiral spline sproingies stairs star starfish strange \
  635. superquadrics swarm swirl tetris thornbird triangle \
  636. tube turtle vines voters wator wire world worm xjack \
  637. blank bomb random)/'
  638. complete xfig 'c/-/(display)/' 'p/*/f:*.fig/'
  639. complete wget c/--/"(accept= append-output= background cache= \
  640. continue convert-links cut-dirs= debug \
  641. delete-after directory-prefix= domains= \
  642. dont-remove-listing dot-style= exclude-directories= \
  643. exclude-domains= execute= follow-ftp \
  644. force-directories force-html glob= header= help \
  645. http-passwd= http-user= ignore-length \
  646. include-directories= input-file= level= mirror \
  647. no-clobber no-directories no-host-directories \
  648. no-host-lookup no-parent non-verbose \
  649. output-document= output-file= passive-ftp \
  650. proxy-passwd= proxy-user= proxy= quiet quota= \
  651. recursive reject= relative retr-symlinks save-headers \
  652. server-response span-hosts spider timeout= \
  653. timestamping tries= user-agent= verbose version wait=)"/
  654. # these from Tom Warzeka <tom@waz.cc>
  655. # this one works but is slow and doesn't descend into subdirectories
  656. # complete cd C@[./\$~]*@d@ \
  657. # p@1@'`\ls -1F . $cdpath | grep /\$ | sort -u`'@ n@*@n@
  658. if ( -r /etc/shells ) then
  659. complete setenv p@1@e@ n@DISPLAY@\$hosts@: n@SHELL@'`cat /etc/shells`'@
  660. else
  661. complete setenv p@1@e@ n@DISPLAY@\$hosts@:
  662. endif
  663. complete unsetenv n/*/e/
  664. set _maildir = /var/mail
  665. if (-r "$HOME/.mailrc") then
  666. complete mail c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
  667. "c@+@F:$HOME/Mail@" C@[./\$~]@f@ n/-s/x:'<subject>'/ \
  668. n@-u@T:$_maildir@ n/-f/f/ \
  669. n@*@'`sed -n s/alias//p "$HOME/.mailrc" | \
  670. tr -s " " " " | cut -f 2`'@
  671. else
  672. complete mail c/-/"(e i f n s u v)"/ c/*@/\$hosts/ \
  673. "c@+@F:$HOME/Mail@" C@[./\$~]@f@ n/-s/x:'<subject>'/ \
  674. n@-u@T:$_maildir@ n/-f/f/ n/*/u/
  675. endif
  676. unset _maildir
  677. if (! $?MANPATH) then
  678. if (-r /usr/share/man) then
  679. setenv MANPATH /usr/share/man:
  680. else
  681. setenv MANPATH /usr/man:
  682. endif
  683. endif
  684. if ($?traditional_complete) then
  685. # use of $MANPATH from Dan Nicolaescu <dann@ics.uci.edu>
  686. # use of 'find' adapted from Lubomir Host <host8@kepler.fmph.uniba.sk>
  687. complete man \
  688. 'n@1@`set q = "$MANPATH:as%:%/man1 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.1.\*\$%%`@'\
  689. 'n@2@`set q = "$MANPATH:as%:%/man2 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.2.\*\$%%`@'\
  690. 'n@3@`set q = "$MANPATH:as%:%/man3 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.3.\*\$%%`@'\
  691. 'n@4@`set q = "$MANPATH:as%:%/man4 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.4.\*\$%%`@'\
  692. 'n@5@`set q = "$MANPATH:as%:%/man5 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.5.\*\$%%`@'\
  693. 'n@6@`set q = "$MANPATH:as%:%/man6 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.6.\*\$%%`@'\
  694. 'n@7@`set q = "$MANPATH:as%:%/man7 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.7.\*\$%%`@'\
  695. 'n@8@`set q = "$MANPATH:as%:%/man8 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.8.\*\$%%`@'\
  696. 'n@9@`set q = "$MANPATH:as%:%/man9 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.9.\*\$%%`@'\
  697. 'n@0@`set q = "$MANPATH:as%:%/man0 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.0.\*\$%%`@'\
  698. 'n@n@`set q = "$MANPATH:as%:%/mann %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.n.\*\$%%`@'\
  699. 'n@o@`set q = "$MANPATH:as%:%/mano %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.o.\*\$%%`@'\
  700. 'n@l@`set q = "$MANPATH:as%:%/manl %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.l.\*\$%%`@'\
  701. 'n@p@`set q = "$MANPATH:as%:%/manp %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.p.\*\$%%`@'\
  702. c@-@"(- f k M P s S t)"@ n@-f@c@ n@-k@x:'<keyword>'@ n@-[MP]@d@ \
  703. 'N@-[MP]@`\ls -1 $:-1/man? |& sed -n s%\\..\\+\$%%p`@' \
  704. 'n@-[sS]@`\ls -1 $MANPATH:as%:% % |& sed -n s%^man%%p | sort -u`@'\
  705. 'n@*@`find $MANPATH:as%:% % \( -type f -o -type l \) -printf "%f " |& sed -e "s%find: .*: No such file or directory%%" -e "s%\([^\.]\+\)\.\([^ ]*\) %\1 %g"`@'
  706. #n@*@c@ # old way -- commands only
  707. else
  708. complete man n@1@'`\ls -1 /usr/man/man1 | sed s%\\.1.\*\$%%`'@ \
  709. n@2@'`\ls -1 /usr/man/man2 | sed s%\\.2.\*\$%%`'@ \
  710. n@3@'`\ls -1 /usr/man/man3 | sed s%\\.3.\*\$%%`'@ \
  711. n@4@'`\ls -1 /usr/man/man4 | sed s%\\.4.\*\$%%`'@ \
  712. n@5@'`\ls -1 /usr/man/man5 | sed s%\\.5.\*\$%%`'@ \
  713. n@6@'`\ls -1 /usr/man/man6 | sed s%\\.6.\*\$%%`'@ \
  714. n@7@'`\ls -1 /usr/man/man7 | sed s%\\.7.\*\$%%`'@ \
  715. n@8@'`\ls -1 /usr/man/man8 | sed s%\\.8.\*\$%%`'@ \
  716. n@9@'`[ -r /usr/man/man9 ] && \ls -1 /usr/man/man9 | sed s%\\.9.\*\$%%`'@ \
  717. n@0@'`[ -r /usr/man/man0 ] && \ls -1 /usr/man/man0 | sed s%\\.0.\*\$%%`'@ \
  718. n@new@'`[ -r /usr/man/mann ] && \ls -1 /usr/man/mann | sed s%\\.n.\*\$%%`'@ \
  719. n@old@'`[ -r /usr/man/mano ] && \ls -1 /usr/man/mano | sed s%\\.o.\*\$%%`'@ \
  720. n@local@'`[ -r /usr/man/manl ] && \ls -1 /usr/man/manl | sed s%\\.l.\*\$%%`'@ \
  721. n@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
  722. c/-/"(- f k P s t)"/ n/-f/c/ n/-k/x:'<keyword>'/ n/-P/d/ \
  723. N@-P@'`\ls -1 $:-1/man? | sed s%\\..\*\$%%`'@ n/*/c/
  724. endif
  725. complete ps c/-t/x:'<tty>'/ c/-/"(a c C e g k l S t u v w x)"/ \
  726. n/-k/x:'<kernel>'/ N/-k/x:'<core_file>'/ n/*/x:'<PID>'/
  727. complete compress c/-/"(c f v b)"/ n/-b/x:'<max_bits>'/ n/*/f:^*.Z/
  728. complete uncompress c/-/"(c f v)"/ n/*/f:*.Z/
  729. complete uuencode p/1/f/ p/2/x:'<decode_pathname>'/ n/*/n/
  730. complete uudecode c/-/"(f)"/ n/-f/f:*.{uu,UU}/ p/1/f:*.{uu,UU}/ n/*/n/
  731. complete xhost c/[+-]/\$hosts/ n/*/\$hosts/
  732. complete xpdf c/-/"(z g remote raise quit cmap rgb papercolor \
  733. eucjp t1lib freetype ps paperw paperh level1 \
  734. upw fullscreen cmd q v h help)"/ \
  735. n/-z/x:'<zoom (-5 .. +5) or "page" or "width">'/ \
  736. n/-g/x:'<geometry>'/ n/-remote/x:'<name>'/ \
  737. n/-rgb/x:'<number>'/ n/-papercolor/x:'<color>'/ \
  738. n/-{t1lib,freetype}/x:'<font_type>'/ \
  739. n/-ps/x:'<PS_file>'/ n/-paperw/x:'<width>'/ \
  740. n/-paperh/x:'<height>'/ n/-upw/x:'<password>'/ \
  741. n/-/f:*.{pdf,PDF}/ \
  742. N/-{z,g,remote,rgb,papercolor,t1lib,freetype,ps,paperw,paperh,upw}/f:*.{pdf,PDF}/ \
  743. N/-/x:'<page>'/ p/1/f:*.{pdf,PDF}/ p/2/x:'<page>'/
  744. complete tcsh c/-D*=/'x:<value>'/ c/-D/'x:<name>'/ \
  745. c/-/"(b c d D e f F i l m n q s t v V x X -version)"/ \
  746. n/-c/c/ n/{-l,--version}/n/ n/*/'f:*.{,t}csh'/
  747. complete rpm c/--/"(query verify nodeps nofiles nomd5 noscripts \
  748. nogpg nopgp install upgrade freshen erase allmatches \
  749. notriggers repackage test rebuild recompile initdb \
  750. rebuilddb addsign resign querytags showrc setperms \
  751. setugids all file group package querybynumber qf \
  752. triggeredby whatprovides whatrequires changelog \
  753. configfiles docfiles dump filesbypkg info last list \
  754. provides queryformat requires scripts state triggers \
  755. triggerscripts allfiles badreloc excludepath checksig \
  756. excludedocs force hash ignoresize ignorearch ignoreos \
  757. includedocs justdb noorder oldpackage percent prefix \
  758. relocate replace-files replacepkgs buildroot clean \
  759. nobuild rmsource rmspec short-circuit sign target \
  760. help version quiet rcfile pipe dbpath root specfile)"/\
  761. c/-/"(q V K i U F e ba bb bp bc bi bl bs ta tb tp tc \
  762. ti tl ts a f g p c d l R s h ? v vv -)"/ \
  763. n/{-f,--file}/f/ n/{-g,--group}/g/ n/--pipe/c/ n/--dbpath/d/ \
  764. n/--querybynumber/x:'<number>'/ n/--triggeredby/x:'<package>'/\
  765. n/--what{provides,requires}/x:'<capability>'/ n/--root/d/ \
  766. n/--{qf,queryformat}/x:'<format>'/ n/--buildroot/d/ \
  767. n/--excludepath/x:'<oldpath>'/ n/--prefix/x:'<newpath>'/ \
  768. n/--relocate/x:'<oldpath=newpath>'/ n/--target/x:'<platform>'/\
  769. n/--rcfile/x:'<filelist>'/ n/--specfile/x:'<specfile>'/ \
  770. n/{-[iUFep],--{install,upgrade,freshen,erase,package}}/f:*.rpm/
  771. # these conform to the latest GNU versions available at press time ...
  772. # updates by John Gotts <jgotts@engin.umich.edu>
  773. if (-X emacs) then
  774. # TW note: if your version of GNU Emacs supports the "--version" option,
  775. # uncomment this line and comment the next to automatically
  776. # detect the version, else set "_emacs_ver" to your version.
  777. #set _emacs_ver=`emacs --version | sed -e 's%GNU Emacs %%' -e q | cut -d . -f1-2`
  778. set _emacs_ver=21.3
  779. set _emacs_dir=`which emacs | sed s%/bin/emacs%%`
  780. complete emacs c/--/"(batch terminal display no-windows no-init-file \
  781. user debug-init unibyte multibyte version help \
  782. no-site-file funcall load eval insert kill)"/ \
  783. c/-/"(t d nw q u f l -)"/ c/+/x:'<line_number>'/ \
  784. n/{-t,--terminal}/x:'<terminal>'/ n/{-d,--display}/x:'<display>'/ \
  785. n/{-u,--user}/u/ n/{-f,--funcall}/x:'<lisp_function>'/ \
  786. n@{-l,--load}@F:$_emacs_dir/share/emacs/$_emacs_ver/lisp@ \
  787. n/--eval/x:'<expression>'/ n/--insert/f/ n/*/f:^*[\#~]/
  788. unset _emacs_ver _emacs_dir
  789. endif
  790. complete gzcat c/--/"(force help license quiet version)"/ \
  791. c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
  792. complete gzip c/--/"(stdout to-stdout decompress uncompress \
  793. force help list license no-name quiet recurse \
  794. suffix test verbose version fast best)"/ \
  795. c/-/"(c d f h l L n q r S t v V 1 2 3 4 5 6 7 8 9 -)"/\
  796. n/{-S,--suffix}/x:'<file_name_suffix>'/ \
  797. n/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
  798. N/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
  799. n/*/f:^*.{gz,Z,z,zip,taz,tgz}/
  800. complete {gunzip,ungzip} c/--/"(stdout to-stdout force help list license \
  801. no-name quiet recurse suffix test verbose version)"/ \
  802. c/-/"(c f h l L n q r S t v V -)"/ \
  803. n/{-S,--suffix}/x:'<file_name_suffix>'/ \
  804. n/*/f:*.{gz,Z,z,zip,taz,tgz}/
  805. complete zgrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
  806. c/-/"(A b B c C e f h i l n s v V w x)"/ \
  807. p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
  808. n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
  809. complete zegrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
  810. c/-/"(A b B c C e f h i l n s v V w x)"/ \
  811. p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
  812. n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
  813. complete zfgrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
  814. c/-/"(A b B c C e f h i l n s v V w x)"/ \
  815. p/1/x:'<fixed_string>'/ N/-*e/f/ \
  816. n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
  817. complete znew c/-/"(f t v 9 P K)"/ n/*/f:*.Z/
  818. complete zmore n/*/f:*.{gz,Z,z,zip}/
  819. complete zfile n/*/f:*.{gz,Z,z,zip,taz,tgz}/
  820. complete ztouch n/*/f:*.{gz,Z,z,zip,taz,tgz}/
  821. complete zforce n/*/f:^*.{gz,tgz}/
  822. complete dcop 'p/1/`$:0`/ /' \
  823. 'p/2/`$:0 $:1 | awk \{print\ \$1\}`/ /' \
  824. 'p/3/`$:0 $:1 $:2 | sed "s%.* \(.*\)(.*%\1%"`/ /'
  825. complete grep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
  826. c/--/"(extended-regexp fixed-regexp basic-regexp \
  827. regexp file ignore-case word-regexp line-regexp \
  828. no-messages revert-match version help byte-offset \
  829. line-number with-filename no-filename quiet silent \
  830. text directories recursive files-without-match \
  831. files-with-matches count before-context after-context \
  832. context binary unix-byte-offsets)"/ \
  833. 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 \
  834. v w x)"/ \
  835. p/1/x:'<limited_regular_expression>'/ N/-*e/f/ \
  836. n/-*e/x:'<limited_regular_expression>'/ n/-*f/f/ n/*/f/
  837. complete egrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
  838. c/--/"(extended-regexp fixed-regexp basic-regexp \
  839. regexp file ignore-case word-regexp line-regexp \
  840. no-messages revert-match version help byte-offset \
  841. line-number with-filename no-filename quiet silent \
  842. text directories recursive files-without-match \
  843. files-with-matches count before-context after-context \
  844. context binary unix-byte-offsets)"/ \
  845. 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 \
  846. v w x)"/ \
  847. p/1/x:'<full_regular_expression>'/ N/-*e/f/ \
  848. n/-*e/x:'<full_regular_expression>'/ n/-*f/f/ n/*/f/
  849. complete fgrep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/\
  850. c/--/"(extended-regexp fixed-regexp basic-regexp \
  851. regexp file ignore-case word-regexp line-regexp \
  852. no-messages revert-match version help byte-offset \
  853. line-number with-filename no-filename quiet silent \
  854. text directories recursive files-without-match \
  855. files-with-matches count before-context after-context \
  856. context binary unix-byte-offsets)"/ \
  857. 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 \
  858. v w x)"/ \
  859. p/1/x:'<fixed_string>'/ N/-*e/f/ \
  860. n/-*e/x:'<fixed_string>'/ n/-*f/f/ n/*/f/
  861. complete sed c/--/"(quiet silent version help expression file)"/ \
  862. c/-/"(n V e f -)"/ n/{-e,--expression}/x:'<script>'/ \
  863. n/{-f,--file}/f:*.sed/ N/-{e,f,-{file,expression}}/f/ \
  864. n/-/x:'<script>'/ N/-/f/ p/1/x:'<script>'/ p/2/f/
  865. complete users c/--/"(help version)"/ p/1/x:'<accounting_file>'/
  866. complete who c/--/"(heading idle count mesg message writable help \
  867. version)"/ c/-/"(H i m q s T w u -)"/ \
  868. p/1/x:'<accounting_file>'/ n/am/"(i)"/ n/are/"(you)"/
  869. complete chown c/--/"(changes dereference no-dereference silent \
  870. quiet reference recursive verbose help version)"/ \
  871. c/-/"(c f h R v -)"/ C@[./\$~]@f@ c/*[.:]/g/ \
  872. n/-/u/: p/1/u/: n/*/f/
  873. complete chgrp c/--/"(changes no-dereference silent quiet reference \
  874. recursive verbose help version)"/ \
  875. c/-/"(c f h R v -)"/ n/-/g/ p/1/g/ n/*/f/
  876. complete chmod c/--/"(changes silent quiet verbose reference \
  877. recursive help version)"/ c/-/"(c f R v)"/
  878. complete df c/--/"(all block-size human-readable si inodes \
  879. kilobytes local megabytes no-sync portability sync \
  880. type print-type exclude-type help version)"/ \
  881. c/-/"(a H h i k l m P T t v x)"/
  882. complete du c/--/"(all block-size bytes total dereference-args \
  883. human-readable si kilobytes count-links dereference \
  884. megabytes separate-dirs summarize one-file-system \
  885. exclude-from exclude max-depth help version"/ \
  886. c/-/"(a b c D H h k L l m S s X x)"/
  887. complete cat c/--/"(number-nonblank number squeeze-blank show-all \
  888. show-nonprinting show-ends show-tabs help version)"/ \
  889. c/-/"(A b E e n s T t u v -)"/ n/*/f/
  890. complete mv c/--/"(backup force interactive update verbose suffix \
  891. version-control help version)"/ \
  892. c/-/"(b f i S u V v -)"/ \
  893. n/{-S,--suffix}/x:'<suffix>'/ \
  894. n/{-V,--version-control}/"(t numbered nil existing \
  895. never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
  896. complete cp c/--/"(archive backup no-dereference force \
  897. interactive link preserve parents sparse recursive \
  898. symbolic-link suffix update verbose version-control \
  899. one-file-system help version)"/ \
  900. c/-/"(a b d f i l P p R r S s u V v x -)"/ \
  901. n/-*r/d/ n/{-S,--suffix}/x:'<suffix>'/ \
  902. n/{-V,--version-control}/"(t numbered nil existing \
  903. never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
  904. complete ln c/--/"(backup directory force no-dereference \
  905. interactive symbolic suffix verbose version-control \
  906. help version)"/ \
  907. c/-/"(b d F f i n S s V v -)"/ \
  908. n/{-S,--suffix}/x:'<suffix>'/ \
  909. n/{-V,--version-control}/"(t numbered nil existing \
  910. never simple)"/ n/-/f/ N/-/x:'<link_name>'/ \
  911. p/1/f/ p/2/x:'<link_name>'/
  912. complete touch c/--/"(date reference time help version)"/ \
  913. c/-/"(a c d f m r t -)"/ \
  914. n/{-d,--date}/x:'<date_string>'/ \
  915. c/--time/"(access atime mtime modify use)"/ \
  916. n/{-r,--file}/f/ n/-t/x:'<time_stamp>'/ n/*/f/
  917. complete mkdir c/--/"(mode parents verbose help version)"/ \
  918. c/-/"(p m -)"/ \
  919. n/{-m,--mode}/x:'<mode>'/ n/*/d/
  920. complete rmdir c/--/"(ignore-fail-on-non-empty parents verbose help \
  921. version)"/ c/-/"(p -)"/ n/*/d/
  922. complete env 'c/*=/f/' 'p/1/e/=/' 'p/2/c/'
  923. complete tar c/-[Acru]*/"(b B C f F g G h i l L M N o P \
  924. R S T v V w W X z Z)"/ \
  925. c/-[dtx]*/"( B C f F g G i k K m M O p P \
  926. R s S T v w x X z Z)"/ \
  927. p/1/"(A c d r t u x -A -c -d -r -t -u -x \
  928. --catenate --concatenate --create --diff --compare \
  929. --delete --append --list --update --extract --get \
  930. --help --version)"/ \
  931. c/--/"(catenate concatenate create diff compare \
  932. delete append list update extract get atime-preserve \
  933. block-size read-full-blocks directory checkpoint file \
  934. force-local info-script new-volume-script incremental \
  935. listed-incremental dereference ignore-zeros \
  936. ignore-failed-read keep-old-files starting-file \
  937. one-file-system tape-length modification-time \
  938. multi-volume after-date newer old-archive portability \
  939. to-stdout same-permissions preserve-permissions \
  940. absolute-paths preserve record-number remove-files \
  941. same-order preserve-order same-owner sparse \
  942. files-from null totals verbose label version \
  943. interactive confirmation verify exclude exclude-from \
  944. compress uncompress gzip ungzip use-compress-program \
  945. block-compress help version)"/ \
  946. c/-/"(b B C f F g G h i k K l L m M N o O p P R s S \
  947. T v V w W X z Z 0 1 2 3 4 5 6 7 -)"/ \
  948. C@/dev@f@ \
  949. n/-c*f/x:'<new_tar_file, device_file, or "-">'/ \
  950. n/{-[Adrtux]j*f,--file}/f:*.{tar.bz2,tbz}/ \
  951. n/{-[Adrtux]z*f,--file}/f:*.{tar.gz,tgz}/ \
  952. n/{-[Adrtux]Z*f,--file}/f:*.{tar.Z,taz}/ \
  953. n/{-[Adrtux]*f,--file}/f:*.tar/ \
  954. N/{-xj*f,--file}/'`tar -tjf $:-1`'/ \
  955. N/{-xz*f,--file}/'`tar -tzf $:-1`'/ \
  956. N/{-xZ*f,--file}/'`tar -tZf $:-1`'/ \
  957. N/{-x*f,--file}/'`tar -tf $:-1`'/ \
  958. n/--use-compress-program/c/ \
  959. n/{-b,--block-size}/x:'<block_size>'/ \
  960. n/{-V,--label}/x:'<volume_label>'/ \
  961. n/{-N,--{after-date,newer}}/x:'<date>'/ \
  962. n/{-L,--tape-length}/x:'<tape_length_in_kB>'/ \
  963. n/{-C,--directory}/d/ \
  964. N/{-C,--directory}/'`\ls $:-1`'/ \
  965. n/-[0-7]/"(l m h)"/
  966. switch ( "$OSTYPE" )
  967. case "linux":
  968. # Linux filesystems
  969. complete mount c/-/"(a f F h l n o r s t U v V w)"/ n/-[hV]/n/ \
  970. n/-o/x:'<options>'/ n/-t/x:'<vfstype>'/ \
  971. n/-L/x:'<label>'/ n/-U/x:'<uuid>'/ \
  972. n@*@'`grep -v "^#" /etc/fstab | tr -s " " " " | cut -f 2`'@
  973. complete umount c/-/"(a h n r t v V)"/ n/-t/x:'<vfstype>'/ \
  974. n/*/'`mount | cut -d " " -f 3`'/
  975. breaksw
  976. case "sunos*":
  977. case "solaris":
  978. # Solaris filesystems
  979. complete mount c/-/"(a F m o O p r v V)"/ n/-p/n/ n/-v/n/ \
  980. n/-o/x:'<FSType_options>'/ \
  981. n@-F@'`\ls -1 /usr/lib/fs`'@ \
  982. n@*@'`grep -v "^#" /etc/vfstab | tr -s " " " " | cut -f 3`'@
  983. complete umount c/-/"(a o V)"/ n/-o/x:'<FSType_options>'/ \
  984. n/*/'`mount | cut -d " " -f 1`'/
  985. complete mountall c/-/"(F l r)"/ n@-F@'`\ls -1 /usr/lib/fs`'@
  986. complete umountall c/-/"(F h k l r s)"/ n@-F@'`\ls -1 /usr/lib/fs`'@ \
  987. n/-h/'`df -k | cut -s -d ":" -f 1 | sort -u`'/
  988. breaksw
  989. case "cygwin":
  990. # Cygwin mounts
  991. complete mount c/-/"(b c f h m o p s t u v x E X)"/ n/-[hmpv]/n/ \
  992. n/-c/x:'/'/ \
  993. n/-o/"(user system binary text exec notexec cygexec nosuid managed)"/ \
  994. n@*@'`mount -p | tail -1 | cut -d " " -f 1 | xargs ls -1 | awk '"'"'{print $1":/"; } END{print "//";}'"'"'`'@
  995. complete umount c/-/"(A c h s S u U v)"/ n/-[AhSUv]/n/ \
  996. n@*@'`mount | grep -v noumount | cut -d " " -f 3`'@
  997. breaksw
  998. default:
  999. breaksw
  1000. endsw
  1001. # these deal with NIS (formerly YP); if it's not running you don't need 'em
  1002. if (-X domainname) then
  1003. set _domain = "`domainname`"
  1004. set _ypdir = /var/yp # directory where NIS (YP) maps are kept
  1005. if ("$_domain" != "" && "$_domain" != "noname") then
  1006. complete domainname p@1@D:$_ypdir@" " n@*@n@
  1007. complete ypcat c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
  1008. N@-d@\`\\ls\ -1\ $_ypdir/\$:-1\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
  1009. n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
  1010. complete ypmatch c@-@"(d k t x)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
  1011. N@-d@x:'<key ...>'@ n@-@x:'<key ...>'@ p@1@x:'<key ...>'@ \
  1012. n@*@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@
  1013. complete ypwhich c@-@"(d m t x V1 V2)"@ n@-x@n@ n@-d@D:$_ypdir@" " \
  1014. n@-m@\`\\ls\ -1\ $_ypdir/$_domain\ \|\ sed\ -n\ s%\\\\.pag\\\$%%p\`@ \
  1015. N@-m@n@ n@*@\$hosts@
  1016. endif
  1017. unset _domain _ypdir
  1018. endif
  1019. complete make \
  1020. 'n/-f/f/' \
  1021. 'c/*=/f/' \
  1022. 'n@*@`cat -s GNUmakefile Makefile makefile |& sed -n -e "/No such file/d" -e "/^[^ #].*:/s/:.*//p"`@'
  1023. if ( -f /etc/printcap ) then
  1024. set printers=(`sed -n -e "/^[^ #].*:/s/:.*//p" /etc/printcap`)
  1025. complete lpr 'c/-P/$printers/'
  1026. complete lpq 'c/-P/$printers/'
  1027. complete lprm 'c/-P/$printers/'
  1028. complete lpquota 'p/1/(-Qprlogger)/' 'c/-P/$printers/'
  1029. complete dvips 'c/-P/$printers/' 'n/-o/f:*.{ps,PS}/' 'n/*/f:*.dvi/'
  1030. complete dvilj 'p/*/f:*.dvi/'
  1031. endif
  1032. # From Alphonse Bendt
  1033. complete ant \
  1034. 'n/-f/f:*.xml/' \
  1035. 'n@*@`cat build.xml | sed -n -e "s/[ \t]*<target[\t\n]*name=.\([a-zA-Z0-9_:]*\).*/\1/p"`@'
  1036. if ($?P4CLIENT && -X perl) then
  1037. # This is from Greg Allen.
  1038. set p4cmds=(add branch branches commands change changes client clients \
  1039. counter counters delete depot depots describe diff diff2 \
  1040. edit filelog files fix fixes fstat group groups have help \
  1041. info integrate integrated job jobs jobspec label labels \
  1042. labelsync lock obliterate opened passwd print protect rename \
  1043. reopen resolve resolved revert review reviews set submit \
  1044. sync triggers unlock user users verify where)
  1045. complete p4 'p/1/$p4cmds/' 'n/help/$p4cmds/' \
  1046. 'n%{-l,label}%`p4 labels | sed "s/Label \([^ ]*\) .*/\1/"`%' \
  1047. 'n%-t%`p4 $:1s | sed "s/[^ ]* \([^ ]*\) .*/\1/"`%' \
  1048. 'c%*@%`p4 labels | sed "s/Label \([^ ]*\) .*/\1/"`%' \
  1049. 'c@//*/*@`p4 files $:-0... |& perl -nle "m%\Q$:-0\E([^#][^/# ] \
  1050. *)%;print "\$"1 if \\\!/no such/&&\!"\$"h{"\$"1}++"`@@' \
  1051. 'c@//@`p4 depots | sed "s/Depot \([^ ]*\) .*/\1/"`@/@'
  1052. endif
  1053. if (! $?traditional_complete) then
  1054. uncomplete vi
  1055. uncomplete vim
  1056. complete {vi,vim,gvim,nvi,elvis} n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/
  1057. 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}/'
  1058. complete elm 'n/-[Ai]/f/' 'c@=@F:$HOME/Mail/@' 'n/-s/x:\<subject\>/'
  1059. complete ncftp 'n@*@`sed -e '1,2d' $HOME/.ncftp/bookmarks | cut -f 1,2 -d "," | tr "," "\012" | sort | uniq ` '@
  1060. complete bibtex 'n@*@`ls *.aux | sed -e "s/\.aux//"`'@
  1061. complete dvi2tty n/*/f:*.dvi/ # Only files that match *.dvi
  1062. uncomplete gv
  1063. uncomplete ghostview
  1064. complete {gv,ghostview} 'n/*/f:*.{ps,eps,epsi}/'
  1065. complete enscript \
  1066. 'c/--/(columns= pages= header= no-header truncate-lines \
  1067. line-numbers setpagedevice= escapes font= \
  1068. header-font= fancy-header no-job-header \
  1069. highlight-bars indent= filter= borders page-prefeed \
  1070. no-page-prefeed lineprinter lines-per-page= mail \
  1071. media= copies= newline= output= missing-characters \
  1072. printer= quiet silent landscape portrait \
  1073. baselineskip= statusdict= title= tabsize= underlay= \
  1074. verbose version encoding pass-through download-font= \
  1075. filter-stdin= help highlight-bar-gray= list-media \
  1076. list-options non-printable-format= page-label-format= \
  1077. printer-options= ul-angle= ul-font= ul-gray= \
  1078. ul-position= ul-style= \
  1079. )/'
  1080. endif
  1081. complete dpkg \
  1082. 'c/--{admindir,instdir,root}=/d/' \
  1083. 'c/--debug=/n/' \
  1084. 'c/--{admindir,debug,instdir,root}/(=)//' \
  1085. 'c/--/(admindir= debug= instdir= root= \
  1086. assert-support-predepends assert-working-epoch \
  1087. audit auto-deconfigure clear-avail \
  1088. compare-versions configure contents control \
  1089. extract force-bad-path field \
  1090. force-configure-any force-conflicts \
  1091. force-depends force-depends-version force-help \
  1092. force-hold force-non-root \
  1093. force-overwrite-diverted \
  1094. force-remove-essential force-remove-reinstreq \
  1095. forget-old-unavail fsys-tarfile get-selections \
  1096. help ignore-depends info install largemem \
  1097. license list listfiles merge-avail no-act \
  1098. pending predep-package print-architecture \
  1099. print-gnu-build-architecture \
  1100. print-installation-architecture print-avail \
  1101. purge record-avail recursive refuse-downgrade \
  1102. remove search set-selections selected-only \
  1103. skip-same-version smallmem status unpack \
  1104. update-avail version vextract \
  1105. )//' \
  1106. 'n/{-l}/`dpkg -l|awk \{print\ \$2\}`/' \
  1107. 'n/*/f:*.deb'/
  1108. complete dpkg-deb 'c/--{build}=/d/' \
  1109. 'c/--/(build contents info field control extract \
  1110. vextract fsys-tarfile help version \
  1111. license)//' \
  1112. 'n/*/f:*.deb/'
  1113. complete apt-get \
  1114. 'c/--/(build config-file diff-only download-only \
  1115. fix-broken fix-missing force-yes help ignore-hold no-download \
  1116. no-upgrade option print-uris purge reinstall quiet simulate \
  1117. show-upgraded target-release tar-only version yes )/' \
  1118. 'c/-/(b c= d f h m o= q qq s t x y )/' \
  1119. 'n/{source,build-dep}/x:<pkgname>/' \
  1120. 'n/{remove}/`dpkg -l|grep ^ii|awk \{print\ \$2\}`/' \
  1121. 'n/{install}/`apt-cache pkgnames | sort`/' \
  1122. 'C/*/(update upgrade dselect-upgrade source \
  1123. build-dep check clean autoclean install remove)/'
  1124. complete apt-cache \
  1125. 'c/--/(all-versions config-file generate full help important \
  1126. names-only option pkg-cache quiet recurse src-cache version )/' \
  1127. 'c/-/(c= h i o= p= q s= v)/' \
  1128. 'n/{search}/x:<regex>/' \
  1129. 'n/{pkgnames,policy,show,showpkg,depends,dotty}/`apt-cache pkgnames | sort`/' \
  1130. 'C/*/(add gencaches showpkg stats dump dumpavail unmet show \
  1131. search depends pkgnames dotty policy )/'
  1132. unset noglob
  1133. unset _complete
  1134. unset traditional_complete
  1135. endif
  1136. end:
  1137. onintr