home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20110725.etc.tar.gz / bradford.20110725.etc.tar / etc / profile.d / complete.tcsh < prev    next >
Text File  |  2006-06-27  |  40KB  |  911 lines

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