### From Michael Schroeder <mlschroe@immd4.informatik.uni-erlangen.de>
    # updates by John Gotts <jgotts@engin.umich.edu>
    # these from Tom Warzeka <tom@waz.cc>



### This allows you to type "slogin price@", hit TAB and get a list of options
set userhosts = (price@mithrandir.ifa.hawaii.edu price@hubble.ifa.hawaii.edu dph8pap@stargate.dur.ac.uk )
set hostnames = `cat $HOME/.ssh/known_hosts | cut -f 1 -d ' ' | cut -f 1 -d ,` >& /dev/null
set hosts = ( $userhosts $hostnames )

#complete ssh		'p/*/$hosts/'
complete ssh    	'p/1/$hosts/' 'c/-/(l n)/'   'n/-l/u/' 'N/-l/c/' 'n/-/c/' 'p/2/c/' 'p/*/f/'
#complete slogin	'p/*/$hosts/'
complete slogin		'p/1/$hosts/' 'c/-/(l 8 e)/' 'n/-l/u/'
#complete scp		'p/1/f/' 'p/*/$hosts/:/'
### This one will rsh to the file to fetch the list of files!
complete scp		'p/1/f/' 'c%*@*:%`set filesonhost=$:-0;set filesonhost="$filesonhost:s/@/ /";set filesonhost="$filesonhost:s/:/ /";set filesonhost=($filesonhost " ");ssh $filesonhost[2] -l $filesonhost[1] ls -dp $filesonhost[3]\*`%' 'c%*:%`set filesonhost=$:-0;set filesonhost="$filesonhost:s/:/ /";set filesonhost=($filesonhost " ");ssh $filesonhost[1] ls -dp $filesonhost[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@'  'n/*/$hosts/:/'

complete finger		'c/*@/$hosts/' 'n/*/u/@'
complete ping		'p/1/$hosts/'
complete traceroute	'p/1/$hosts/'
 
complete ftp		'c/-/(d i g n v)/' 'n/-/$hosts/' 'p/1/$hosts/' 'n/*/n/'

### Directory completion
complete {c,push,p}d 'p/1/d/'

### Common commands
complete man		'p/*/c/'
complete which		'p/*/c/'    
complete where		'p/*/c/'
complete printenv	'n/*/e/'
complete setenv		'p/1/e/' 'c/*:/f/'
complete set		'c/*=/f/' 'p/1/s/=' 'n/=/f/'
complete unset		'n/*/s/'
complete unalias	'n/*/a/'
complete limit		'c/-/(h)/' 'n/*/l/'
complete unlimit	'c/-/(h)/' 'n/*/l/'
complete su		'c/--/(login fast preserve-environment command shell \
				help version)/' 'c/-/(f l m p c s -)/' \
			'n/{-c,--command}/c/' \
			'n@{-s,--shell}@`cat /etc/shells`@' 'n/*/u/'

complete grep		'c/-*A/x:<#_lines_after>/' 'c/-*B/x:<#_lines_before>/' \
			'c/--/(extended-regexp fixed-regexp basic-regexp \
			      regexp file ignore-case word-regexp line-regexp \
			      no-messages revert-match version help byte-offset \
			      line-number with-filename no-filename quiet silent \
			      text directories recursive files-without-match \
			      files-with-matches count before-context after-context \
			      context binary unix-byte-offsets)/' \
			'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)/' \
			'p/1/x:<limited_regular_expression>/' 'N/-*e/f/' \
			'n/-*e/x:<limited_regular_expression>/' 'n/-*f/f/' 'n/*/f/'

complete egrep		'c/-*A/x:<#_lines_after>/' 'c/-*B/x:<#_lines_before>/' \
			'c/--/(extended-regexp fixed-regexp basic-regexp \
			      regexp file ignore-case word-regexp line-regexp \
			      no-messages revert-match version help byte-offset \
			      line-number with-filename no-filename quiet silent \
			      text directories recursive files-without-match \
			      files-with-matches count before-context after-context \
			      context binary unix-byte-offsets)/' \
			'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)/' \
			'p/1/x:<full_regular_expression>/' 'N/-*e/f/' \
			'n/-*e/x:<full_regular_expression>/' 'n/-*f/f/' 'n/*/f/'

complete fgrep		'c/-*A/x:<#_lines_after>/' 'c/-*B/x:<#_lines_before>/' \
			'c/--/(extended-regexp fixed-regexp basic-regexp \
			      regexp file ignore-case word-regexp line-regexp \
			      no-messages revert-match version help byte-offset \
			      line-number with-filename no-filename quiet silent \
			      text directories recursive files-without-match \
			      files-with-matches count before-context after-context \
			      context binary unix-byte-offsets)/' \
			'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)/' \
			'p/1/x:<fixed_string>/' 'N/-*e/f/' \
			'n/-*e/x:<fixed_string>/' 'n/-*f/f/' 'n/*/f/'
 
complete sed		'c/--/(quiet silent version help expression file)/'   \
			'c/-/(n V e f -)/' 'n/{-e,--expression}/x:<script>/'  \
			'n/{-f,--file}/f:*.sed/' 'N/-{e,f,-{file,expression}}/f/' \
			'n/-/x:<script>/' 'N/-/f/' 'p/1/x:<script>/' 'p/2/f/'
 
complete who		'c/--/(heading idle count mesg message writable help \
			      version)/' 'c/-/(H i m q s T w u -)/' \
			'p/1/x:<accounting_file>/' 'n/am/(i)/' 'n/are/(you)/'
 
complete chown		'c/--/(changes dereference no-dereference silent \
			      quiet reference recursive verbose help version)/' \
			'c/-/(c f h R v -)/' 'C@[./$~]@f@' 'c/*[.:]/g/' \
			'n/-/u/' 'p/1/u/' 'n/*/f/'

complete chgrp		'c/--/(changes no-dereference silent quiet reference \
			      recursive verbose help version)/' \
			'c/-/(c f h R v -)/' 'n/-/g/' 'p/1/g/' 'n/*/f/'

complete chmod		'c/--/(changes silent quiet verbose reference \
			      recursive help version)/' 'c/-/(c f R v)/'

complete df		'c/--/(all block-size human-readable si inodes \
			      kilobytes local megabytes no-sync portability sync \
			      type print-type exclude-type help version)/' \
			'c/-/(a H h i k l m P T t v x)/'

complete du		'c/--/(all block-size bytes total dereference-args \
			      human-readable si kilobytes count-links dereference \
			      megabytes separate-dirs summarize one-file-system \
			      exclude-from exclude max-depth help version"/' \
			'c/-/(a b c D H h k L l m S s X x)/'

complete cat		'c/--/(number-nonblank number squeeze-blank show-all \
			      show-nonprinting show-ends show-tabs help version)/' \
			'c/-/(A b E e n s T t u v -)/' 'n/*/f/'

complete mv		'c/--/(backup force interactive update verbose suffix \
			      version-control help version)/' \
			'c/-/(b f i S u V v -)/' \
			'n/{-S,--suffix}/x:<suffix>/' \
			'n/{-V,--version-control}/(t numbered nil existing \
				never simple)/' 'n/-/f/' 'N/-/d/' 'n/*/f/'

complete cp		'c/--/(archive backup no-dereference force \
			      interactive link preserve parents sparse recursive \
			      symbolic-link suffix update verbose version-control \
			      one-file-system help version)/' \
			'c/-/(a b d f i l P p R r S s u V v x -)/' \
			'n/-*r/d/' 'n/{-S,--suffix}/x:<suffix>/' \
			'n/{-V,--version-control}/(t numbered nil existing \
			never simple)/' 'n/-/f/' 'N/-/d/' 'p/1/f/' 'p/2/d/' 'n/*/f/'

complete ln		'c/--/(backup directory force no-dereference \
			      interactive symbolic suffix verbose version-control \
			      help version)/' \
			'c/-/(b d F f i n S s V v -)/' \
			'n/{-S,--suffix}/x:<suffix>/' \
			'n/{-V,--version-control}/(t numbered nil existing \
			never simple)/' 'n/-/f/' 'N/-/x:<link_name>/' \
			'p/1/f/' 'p/2/x:<link_name>/'

complete touch		'c/--/(date reference time help version)/' \
			'c/-/(a c d f m r t -)/' \
			'n/{-d,--date}/x:<date_string>/' \
			'c/--time/(access atime mtime modify use)/' \
			'n/{-r,--file}/f/' 'n/-t/x:<time_stamp>/' 'n/*/f/'

complete mkdir		'c/--/(mode parents verbose help version)/' \
			'c/-/(p m -)/' \
			'n/{-m,--mode}/x:<mode>/' 'n/*/d/'

complete rmdir		'c/--/(ignore-fail-on-non-empty parents verbose help \
			      version)/' 'c/-/(p -)/' 'n/*/d/'


### File handling
complete rm		'c/--/(directory force interactive verbose \
                        recursive help version)/' 'c/-/(d f i v r R -)/' \
                        'n/*/f:^*.{c,cc,C,h,in}/' # Protect precious files

complete find		'n/-fstype/(nfs 4.2)/' 'n/-name/f/' \
			'n/-type/(c b d f p l s)/' 'n/-user/u/' 'n/-group/g/' \
			'n/-exec/c/' 'n/-ok/c/' 'n/-cpio/f/' 'n/-ncpio/f/' 'n/-newer/f/' \
			'c/-/(fstype name perm prune type user nouser \
			      group nogroup size inum atime mtime ctime exec \
			      ok print ls cpio ncpio newer xdev depth \
			      daystart follow maxdepth mindepth noleaf version \
			      anewer cnewer amin cmin mmin true false uid gid \
			      ilname iname ipath iregex links lname empty path \
			      regex used xtype fprint fprint0 fprintf \
			      print0 printf not a and o or)/' \
			'n/*/d/'

complete tar		'c/-[Acru]*/(b B C f F g G h i l L M N o P \
			            R S T v V w W X z Z)/' \
			'c/-[dtx]*/( B C f F g G i k K m M O p P \
				    R s S T v w x X z Z)/' \
			'p/1/(A c d r t u x -A -c -d -r -t -u -x \
			     --catenate --concatenate --create --diff --compare \
			     --delete --append --list --update --extract --get \
			     --help --version)/' \
			'c/--/(catenate concatenate create diff compare \
			      delete append list update extract get atime-preserve \
			      block-size read-full-blocks directory checkpoint file \
			      force-local info-script new-volume-script incremental \
			      listed-incremental dereference ignore-zeros \
			      ignore-failed-read keep-old-files starting-file \
			      one-file-system tape-length modification-time \
			      multi-volume after-date newer old-archive portability \
			      to-stdout same-permissions preserve-permissions \
			      absolute-paths preserve record-number remove-files \
			      same-order preserve-order same-owner sparse \
			      files-from null totals verbose label version \
			      interactive confirmation verify exclude exclude-from \
			      compress uncompress gzip ungzip use-compress-program \
			      block-compress help version)/' \
			'c/-/(b B C f F g G h i k K l L m M N o O p P R s S \
			     T v V w W X z Z 0 1 2 3 4 5 6 7 -)/' \
			'C@[/dev]@f@' \
			'n/-c*f/x:<new_tar_file, device_file, or "-">/' \
			'n/{-[Adrtux]*f,--file}/f:*.{tar,taz,tgz,tar.gz,tar.bz2}/' \
#			'N/{-x*f,--file}/'`tar -tf $:-1`'/' \
			'n/--use-compress-program/c/' \
			'n/{-b,--block-size}/x:<block_size>/' \
			'n/{-V,--label}/x:<volume_label>/' \
			'n/{-N,--{after-date,newer}}/x:<date>/' \
			'n/{-L,--tape-length}/x:<tape_length_in_kB>/' \
			'n/{-C,--directory}/d/' \
#			'N/{-C,--directory}/'`\ls $:-1`'/' \
			'n/-[0-7]/(l m h)/'

complete zcat		'c/--/(force help license quiet version)/' \
			'c/-/(f h L q V -)/' 'n/*/f:*.{gz,Z,z,zip}/'

complete gzip		'c/--/(stdout to-stdout decompress uncompress \
			      force help list license no-name quiet recurse \
			      suffix test verbose version fast best)/' \
			      'c/-/(c d f h l L n q r S t v V 1 2 3 4 5 6 7 8 9 -)/' \
			'n/{-S,--suffix}/x:<file_name_suffix>/' \
			'n/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/' \
			'N/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/' \
			'n/*/f:^*.{gz,Z,z,zip,taz,tgz}/'

complete {gunzip,ungzip}	'c/--/(stdout to-stdout force help list license \
				no-name quiet recurse suffix test verbose version)/' \
				'c/-/(c f h l L n q r S t v V -)/' \
				'n/{-S,--suffix}/x:<file_name_suffix>/' \
				'n/*/f:*.{gz,Z,z,zip,taz,tgz}/'

complete unzip		'p/*/f:*.zip/'
complete bunzip2	'p/*/f:*.bz2/'
complete bzip2		'n/-9/f:^*.bz2/' 'n/-d/f:*.bz2/'
complete compress	'c/-/(c f v b)/' 'n/-b/x:<max_bits>/' 'n/*/f:^*.Z/'
complete uncompress	'c/-/(c f v)/' 'n/*/f:*.Z/'
complete uuencode	'p/1/f/' 'p/2/x:<decode_pathname>/' 'n/*/n/'
complete uudecode	'c/-/(f)/' 'n/-f/f:*.{uu,UU}/' 'p/1/f:*.{uu,UU}/' 'n/*/n/'
complete gpg		'n/{--encrypt,--encrypt-files,--decrypt,--decrypt-files}/f/' \
			'c/--/(sign clearsign detach-sign encrypt encrypt-files \
			       store decrypt decrypt-files verify list-keys list-sigs \
			       check-sigs fingerprint gen-key delete-keys sign-key \
			       edit-key gen-revoke export send-keys recv-keys \
			       search-keys import dearmor enarmor armor recipient \
			       verbose quiet interactive keyring show-keyring \
			       keyserver)/' \
			'c/-/(-)//'


### Documents
complete xdvi		'c/-/(allowshell debug display expert gamma hushchars \
			      hushchecksums hushspecials install interpreter keep \
			      margins nogrey noinstall nomakepk noscan paper safer \
			      shrinkbuttonn thorough topmargin underlink version)/' \
			'n/-paper/(a4 a4r a5 a5r)/' 'p/*/f:*.dvi/'

complete dvi{ps,pdf}	'n/*/f:*.dvi/'
complete tex		'n/*/f:*.tex/'
complete latex		'n/*/f:*.tex/'
complete ghostview	'p/*/f:*.ps/'
complete gv		'p/*/f:*.{ps,eps,ps.gz,eps.gz,pdf}/'
complete ggv		'n/*/f:*.{ps,eps,ps.gz,eps.gz,pdf}/'
complete xpdf 		'c/-/(z g remote raise quit cmap rgb papercolor       \
                               eucjp t1lib freetype ps paperw paperh level1    \
                               upw fullscreen cmd q v h help)/'                \
                         'n/-z/x:<zoom (-5 .. +5) or "page" or "width">/'      \
                         'n/-g/x:<geometry>/' 'n/-remote/x:<name>/'            \
                         'n/-rgb/x:<number>/' 'n/-papercolor/x:<color>/'       \
                         'n/-{t1lib,freetype}/x:<font_type>/'                  \
                         'n/-ps/x:<PS_file>/' 'n/-paperw/x:<width>/'           \
                         'n/-paperh/x:<height>/' 'n/-upw/x:<password>/'        \
                         'n/-/f:*.{pdf,PDF}/'                                  \
                         'N/-{z,g,remote,rgb,papercolor,t1lib,freetype,ps,paperw,paperh,upw}/f:*.{pdf,PDF}/' \
                         'N/-/x:<page>/' 'p/1/f:*.{pdf,PDF}/' 'p/2/x:<page>/'

complete gs		'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc \
				      dfaxhigh dfaxlow laserjet ljet4 sparc pbm \
				      pbmraw pgm pgmraw ppm ppmraw bit)/' \
			'c/-sOutputFile=/f/' 'c/-s/(DEVICE OutputFile)/=' \
			'c/-d/(NODISPLAY NOPLATFONTS NOPAUSE)/' 'n/*/f/'

 

### Editing
complete {vi,vim}	'n/*/f:^*.[oa]/'
complete xfig		'c/-/(display)/' 'p/*/f:*.fig/'
### Emacs
set _emacs_ver=`emacs --version | sed -e 's%GNU Emacs %%' -e q | cut -d . -f1-2`
set _emacs_dir=`which emacs | sed s%/bin/emacs%%`
complete emacs		'c/--/(batch terminal display no-windows no-init-file \
			      user debug-init unibyte multibyte version help \
			      no-site-file funcall load eval insert kill)/' \
			'c/-/(t d nw q u f l -)/' 'c/+/x:<line_number>/' \
			'n/{-t,--terminal}/x:<terminal>/' 'n/{-d,--display}/x:<display>/' \
			'n/{-u,--user}/u/' 'n/{-f,--funcall}/x:<lisp_function>/' \
			'n@{-l,--load}@F:$_emacs_dir/share/emacs/$_emacs_ver/lisp@' \
			'n/--eval/x:<expression>/' 'n/--insert/f/' 'n/*/f:^*[\#~]/'
unset _emacs_ver _emacs_dir


### Programming
complete ./configure	'c/--*=/f/' 'c/--{cache-file,prefix,exec-prefix,\
					  bindir,sbindir,libexecdir,datadir,\
					  sysconfdir,sharedstatedir,localstatedir,\
					  libdir,includedir,oldincludedir,infodir,\
					  mandir,srcdir}/(=)//' \
			'c/--/(cache-file verbose prefix exec-prefix bindir \
			       sbindir libexecdir datadir sysconfdir \
			       sharedstatedir localstatedir libdir \
			       includedir oldincludedir infodir mandir \
			       srcdir)//'

complete ./autogen.sh	'c/--*=/f/' 'c/--{cache-file,prefix,exec-prefix,\
					  bindir,sbindir,libexecdir,datadir,\
					  sysconfdir,sharedstatedir,localstatedir,\
					  libdir,includedir,oldincludedir,infodir,\
					  mandir,srcdir}/(=)//' \
			'c/--/(cache-file verbose prefix exec-prefix bindir \
			       sbindir libexecdir datadir sysconfdir \
			       sharedstatedir localstatedir libdir \
			       includedir oldincludedir infodir mandir \
			       srcdir)//'

complete gcc		'c/-[IL]/d/' \
                        'c/-f/(caller-saves cse-follow-jumps delayed-branch \
			       elide-constructors expensive-optimizations \
			       float-store force-addr force-mem inline \
			       inline-functions keep-inline-functions \
			       memoize-lookups no-default-inline \
			       no-defer-pop no-function-cse omit-frame-pointer \
			       rerun-cse-after-loop schedule-insns \
			       schedule-insns2 strength-reduce \
			       thread-jumps unroll-all-loops \
			       unroll-loops syntax-only all-virtual \
			       cond-mismatch dollars-in-identifiers \
			       enum-int-equiv no-asm no-builtin \
			       no-strict-prototype signed-bitfields \
			       signed-char this-is-variable unsigned-bitfields \
			       unsigned-char writable-strings call-saved-reg \
			       call-used-reg fixed-reg no-common \
			       no-gnu-binutils nonnull-objects \
			       pcc-struct-return pic PIC shared-data \
			       short-enums short-double volatile)/' \
                        'c/-W/(all aggregate-return cast-align cast-qual \
			       comment conversion enum-clash error format \
			       id-clash-len implicit missing-prototypes \
			       no-parentheses pointer-arith return-type shadow \
			       strict-prototypes switch uninitialized unused \
			       write-strings)/' \
                        'c/-m/(68000 68020 68881 bitfield fpa nobitfield rtd \
			       short c68000 c68020 soft-float g gnu unix fpu \
			       no-epilogue)/' \
                        'c/-d/(D M N)/' \
                        'c/-/(f W vspec v vpath ansi traditional \
			      traditional-cpp trigraphs pedantic x o l c g L \
			      I D U O O2 C E H B b V M MD MM i dynamic \
			      nodtdlib static nostdinc undef)/' \
                        'c/-l/f:*.a/' \
                        'n/*/f:*.{c,C,cc,o,a,s,i}/'

complete objdump	'c/--/(adjust-vma= all-headers architecture= \
			       archive-headers debugging demangle disassemble \
			       disassemble-all disassemble-zeroes dynamic-reloc \
			       dynamic-syms endian= file-headers full-contents \
			       headers help info line-numbers no-show-raw-insn \
			       prefix-addresses private-headers reloc section-headers \
			       section=source stabs start-address= stop-address= \
			       syms target= version wide)/' \
			'c/-/(a h i f C d D p r R t T x s S l w)/'

complete ar		'c/[dmpqrtx]/(c l o u v a b i)/' 'p/1/(d m p q r t x)//' \
			'p/2/f:*.a/' 'p/*/f:*.o/'
 
complete make		'n/-f/f/' 'c/*=/f/' \
			'n@*@`cat -s GNUmakefile Makefile makefile |& sed -n -e "/No such file/d" -e "/^[^     #].*:/s/:.*//p"`@'

complete g++		'n/*/f:*.{C,cc,o,s,i}/'
complete gdb		'p/2/f:core*/' 'n/-d/d/' 'n/*/c/'



### Jobs
complete -%*		'c/%/j/'
complete kill		'c/-/S/' 'c/%/j/' 'p/*/`ps -u $USER -opid=`/'
complete {fg,bg,stop}	'c/%/j/' 'p/1/(%)//'
complete ps		'c/-t/x:<tty>/' 'c/-/(a c C e g k l S t u v w x)/' \
			'n/-k/x:<kernel>/' 'N/-k/x:<core_file>/' 'n/-u/u/' 'n/*/x:<PID>/'


### System
complete xhost		'c/[+-]/$hosts/' 'n/*/$hosts/'
complete xmodmap	'c/-/(display help grammar verbose quiet n e pm pk pke pp)/'
complete netstat	'n@-I@`ifconfig -l`@'
complete ifconfig	'p@1@`ifconfig -l`@' 'n/*/(range phase link netmask \
						   mtu vlandev vlan metric \
						   mediaopt down delete \
						   broadcast arp debug)/'

complete mixer		'p/1/(vol bass treble synth pcm speaker mic cd mix \
			      pcm2 rec igain ogain line1 line2 line3)/' \
			      p@2@'`mixer $:-1 | awk \{\ print\ $7\ \}`'@

complete mount		'c/-/(a r t v)/' 'n/-t/(4.2 nfs)/' \
			'n@*@''`grep -v "^#" /etc/fstab | tr -s " " "     " | cut -f 2`''@'
complete umount		'c/-/(a h t v)/' 'n/-t/(4.2 nfs)/' \
			'n/-h/''`df | cut -s -d ":" -f 1 | sort -u`''/' \
			'n/*/''`mount | cut -d " " -f 3`''/'

 
### Mail
### Set _maildir to Post Office: /var/spool/mail or /usr/mail
set _maildir = /var/spool/mail
if (-r $HOME/.mailrc) then
	complete mail	'c/-/(e i f n s u v)/' 'c/*@/$hosts/' \
			'c@+@F:$HOME/Mail@' 'C@[./$~]@f@' 'n/-s/x:<subject>/' \
			'n@-u@T:$_maildir@' 'n/-f/f/' \
			'n@*@`sed -n s/alias//p $HOME/.mailrc | tr -s " " " " | cut -f 2`@'
else
	complete mail	'c/-/(e i f n s u v)/' 'c/*@/$hosts/' \
			'c@+@F:$HOME/Mail@' 'C@[./$~]@f@' 'n/-s/x:<subject>/' \
			'n@-u@T:$_maildir@' 'n/-f/f/' 'n/*/u/'
endif
unset  _maildir


### Printing
if ( -f /etc/printcap ) then
	set _printers=(`sed -n -e "/^[^     #].*:/s/:.*//p" /etc/printcap`)
	complete lpr		'c/-P/$printers/'
	complete lpq		'c/-P/$printers/'
	complete lprm		'c/-P/$printers/'
	complete lpquota	'p/1/(-Qprlogger)/' 'c/-P/$printers/'
	complete dvips		'c/-P/$printers/' 'n/-o/f:*.{ps,PS}/' 'n/*/f:*.dvi/'
	complete dvilj		'p/*/f:*.dvi/'
	unset _printers
endif

 
### Other applications
complete perl		'n/-S/c/'
complete cvs		'c/--/(help help-commands help-synonyms)/' \
			'p/1/(add admin annotate checkout commit diff \
			      edit editors export history import init log login \
			      logout rdiff release remove rtag status tag unedit \
			      update watch watchers)/' 'n/-a/(edit unedit commit \
			      all none)/' 'n/watch/(on off add remove)/'

complete links		'c/-/(assume-codepage async-dns download-dir \
			      format-cache-size ftp-proxy help http-proxy \
			      max-connections max-connections-to-host \
			      memory-cache-size receive-timeout retries \
			      unrestartable-receive-timeout version \
			      source dump)/'

complete wget		'c/--/(accept= append-output= background cache= \
			      continue convert-links cut-dirs= debug \
			      delete-after directory-prefix= domains= \
			      dont-remove-listing dot-style= exclude-directories= \
			      exclude-domains= execute= follow-ftp \
			      force-directories force-html glob= header= help \
			      http-passwd= http-user= ignore-length \
			      include-directories= input-file= level= mirror \
			      no-clobber no-directories no-host-directories \
			      no-host-lookup no-parent non-verbose \
			      output-document= output-file= passive-ftp \
			      proxy-passwd= proxy-user= proxy= quiet quota= \
			      recursive reject= relative retr-symlinks save-headers \
			      server-response span-hosts spider timeout= \
			      timestamping tries= user-agent= verbose version wait=)/' 

complete mpg123		'c/--/(2to1 4to1 8bit aggressive au audiodevice \
			       auth buffer cdr check doublespeed equalizer frames \
			       gain halfspeed headphones left lineout list mix mono \
			       proxy quiet random rate reopen resync right scale \
			       shuffle single0 single1 skip speaker stdout stereo \
			       test verbose wav)/' 'p/*/f:*.{mp2,mp3}/'

complete ds9		'c/-/(2mass about bin blink blue catalog cmap contour crosshair datacube dss \
				exit quit fits sfits frame geometry green grid height help histequ \
				iconify invert linear lock log lower match medatacube minmax mode \
				mosaicimage mosaicimagenext mosaic smosaic nameserver orient \
				pagesetup pan pixeltable plot pow prefs preserve print private raise \
				regions red rgb rgbarray rgbcube srgbcube rgbimage rotate saveimage \
				savefits savempg scale shm single smooth squared sqrt source tile \
				title url version view visual vo wcs web width xpa zmax zscale zoom)/' \
			'n/-2mass/(name coord survey size)/' \
			'N/-2mass/x:<object name, ra dec coordinates, survey (j|h|k) or size (arcsec)>/' \
			'n/-analysis,-fits,-sfits,-mosaicimage,-mosaicimagenext,-mosaic,-medatacube,\
				-rgbcube,-srgbcube,-rgbimage,-savefits,-savempeg,-source/f/' \
			'N/-sfits,-srgbcube,-smosaic/f/' \
			'n/-datacube/(play stop next prev first last)/' \
			'n/-dss/(name coord size server survey)/' \
			'N/-dss/x:<object name, coordinates, size, server (sao|stsci|eso) or survey>/' \
			'n/-frame/(center clear new delete reset refresh hide show first next prev last)/' \
			'n/-mode/(none pointer crosshair colorbar pan zoom rotate catalog examine)/' \
			'n/-orient/(none x y xy)/' \
			'n/-pixeltable/(yes no)/' \
			'n/-preserve/(scale pan regions)/' 'N/-preserve/(yes no)/' \
			'n/-regions/(load save move select delete format system sky skyformat strip wcs \
				shape color width)/' \
			'N/-regions/x:<Check the manual for the great variety of values>/' \
			'n/-rgb/(red green blue channel view system lock)/' \
			'n/-scale/(linear log pow sqrt squared histequ)/' \
			'n/-smooth/(yes no function radius)/' \
			'n/-tile/(yes no grid row column)/'

