completions   [plain text]


##
# TCSH Expanded C-Shell INITIALIZATION FILE
# Completions file
#
# Wilfredo Sanchez Jr. | tritan@mit.edu
# June 10, 1994
#
# MIT Project Athena
#
# Some of these are borrowed from complete.tcsh in the tcsh source tree
# and from several other sources.
##
# Syntax:
# <command>/<match-pattern>/<complete-action>/[<suffix>|/]
#
# Commands:
# p   = position
# n,N = next-word
# c,C = current-word
##

# Directories
complete {cd,chdir,popd,pushd}	'p/1/d/'
complete files			'p/1/d/'
complete {mkdir,rmdir}		'p/1/d/'

# Commands
complete man			'n/-M/d/' 'p/*/c/'
complete {where,which}		'p/1/c/'
complete exec			'p/1/c/'
complete {trace,strace}		'p/1/c/'

# Aliases
complete alias			'p/1/a/' 'p/2/c/'
complete unalias		'p/*/a/'

# Jobs, Processes
complete kill			'c/%/j/' 'c/-/S/' 'p/1/(% -)/'
complete {fg,bg,stop}		'c/%/j/' 'p/1/(%)//'

# Limits
complete {limit,unlimit}	'c/-/(h)/' 'n/*/l/'

# Variables
complete printenv		'p/1/e/'
complete set			'c/*=/f/' 'p/1/s/=' 'n/=/f/'
complete unset			'p/*/s/'
complete setenv			'p/1/e/'
complete unsetenv		'p/*/e/'

# Completions
complete complete		'p/1/X/'
complete uncomplete		'n/*/X/'

# Bindings
complete bindkey		'p/2/b/'

# Files by extension
complete gunzip				'p/*/f:*.{gz,tgz}/'
complete rm				'p/*/f/' 'c/-/(r f)/'
complete {tar,gtar,gnutar}		'p/1/(xvf cvf tvf)//' 'p/2-/f/'
complete {uncompress,zcat,gzcat}	'p/*/f:*.{Z,gz}/'
complete unzip				'p/*/f:*.zip/'

# Hosts
complete finger			'c/*@/`list_all_hostnames`/' 'n/*/u/@'
complete {ftp,ncftp,telnet}	'p/*/`list_all_hostnames`/'
complete {ping,traceroute}	'p/*/`list_all_hostnames`/'
complete rlogin			'p/1/`list_all_hostnames`/' 'c/-/(l 8 e)/' 'n/-l/u/'
complete rsh			'p/1/`list_all_hostnames`/' 'c/-/(l n)/' 'n/-l/u/' 'N/-l/c/' 'n/-/c/' 'p/2/c/' 'p/*/f/'
complete ssh                                                                    \
        'c/-/(a A c C e f g k n N o p P q t T v x X 2 4 6)/'                    \
        'n/-c/(arcfour blowfish blowfish-cbc cast128-cbc none 3des 3des-cbc)/'  \
        'n/-e/(ch ^ch none)/'                                                   \
        'n/-i/f/'                                                               \
        'n/-l/u/'                                                               \
        'n/-{o,p,L,R}/()/'                                                      \
        'c/*:/`list_all_hostnames`/:'                                           \
        'c/*@/`list_all_hostnames`/'                                            \
        'p/*/`list_all_hostnames`/'

# Override this with something smarter if you wish
alias list_all_hostnames 'grep -v "^#" /etc/hosts'

# Users and Groups
complete chmod                  'p/1/(u g o a)//'		\
				'n/-R/(u g o a)//'
complete chgrp			'p/1/g/' 'n/-R/g/' 'p/*/f/'
complete chown			'p/1/u/' 'n/-R/u/' 'p/*/f/'

complete su			'c/-/(f l m K)/'			\
				'p/1/u/'				\
				'n/-[flmK]/u/'

complete sudo			'n/-u/u/'				\
				'n/-p/n/'				\
				'n/-V/n/'				\
				'n/-c/(-)/'				\
				'n/-H/d/'				\
				'c/-/(V h l L v k K s H S b p c u -)/'	\
				'p/1/c/'				\
				'n/-[hlLvkKsSb-]/c/'			\
				'N/-[upcH]/c/'

# URLs
complete {lynx,netscape,wget} 	'p|1|(ftp:// gopher:// http:// https:// mailto: news: wais:// )||'

##
# Misc
##

complete {configure,./configure}							\
	'c@{--target=,--host=}@`cat /tmp/architectures`@'				\
	'c/--/(help quiet silent version no-create					\
		target= build= host=							\
		prefix= exec-prefix= bindir= sbindir= libdir= libexecdir=		\
		includedir= infodir= mandir= srcdir=					\
		datadir= sysconfdir= sharedstatedir= localstatedir=			\
		program-prefix= program-suffix= program-transform-name=			\
		x-includes= x-libraries=						\
		with-cc= with-ccopts= with-linker= with-ldopts= with-cppopts=		\
		disable- enable- enable-shared with- without-)//'

#set cvs_cmds      = (add admin annotate checkout commit diff edit editors export			\
#		     history import init log login rdiff patch release remove rtag status tag		\
#		     unedit update watch watchers)
#set cvs_opts      = (-H -Q -q -r -w -l -n -t -v -b -T -e -d -f -z -a -s)
#set cvs_opts_cmds = (${cvs_opts} ${cvs_cmds} --help --help-options --help-commands --version)
#complete cvs									\
#	"n/cvs/(${cvs_opts_cmds})/"						\
#	"n/-[HQqrwlntvdfas]/(${cvs_opts_cmds})/"				\
#	'n/-[bT]/d/' 'n/-e/c/' 'n/-z/(1 9)/'					\
#	"N/-[bTez]/(${cvs_opts_cmds})/"						\
#	"n/--help/(${cvs_cmds})/"						\
#	'n/add/(-k -m `ls`)/'							\
#	'n/annotate/(-l -R -f -r -D `ls`)/'					\
#	'n/checkout/(-A -N -P -R -c -f -l -n -p -s -d -D -j -k)/'		\
#	'n/commit/(-n -R -l -f -m -F -r `ls`)/'					\
#	'n/diff/(-l -N -R -r -D --ifdef= `ls`)/'				\
#	'n/edit/(-l -R -a `ls`)/'						\
#	'n/editors/(-l -R `ls`)/'						\
#	'n/export/(-N -R -f -l -n -D -d -k)/'					\
#	'n/history/(-T -c -o -m -a -e -l -w -D -b -f -p -r -u -z `ls`)/'	\
#	'n/import/(-d -k -I -m -b)/'						\
#	'n/log/(-l -R -h -t -N -b -r -d -s `ls`)/'				\
#	'n/rdiff/(-f -l -R -c -u -s -t -V)/'					\
#	'n/release/(-d)/'							\
#	'n/remove/(-f -l -R)/'							\
#	'n/rtag/(-a -f -l -R -n -F -b -d -r -D)/'				\
#	'n/status/`ls && echo -v -l -R`/'					\
#	'n/tag/(-l -R -F -b -d -c -r -D `ls`)/'					\
#	'n/unedit/(-l -R -a `ls`)/'						\
#	'n/update/(-A -P -d -f -l -R -p -k -r -D -j -I -W `ls`)/'		\
#	'n/watch/(on off add remove -l -R -a `ls`)/'	 			\
#	'n/watchers/(-l -R `ls`)/'						\
#	'n/-a/(edit unedit commit all none)/'
#unset cvs_cmds cvs_opts cvs_opts_cmds

complete dd										\
	'c/--/(help version)/'								\
	'c/[io]f=/f/'									\
	'c/conv=*,/(ascii ebcdic ibm block unblock lcase ucase swab noerror sync)/,'	\
	'c/conv=/(ascii ebcdic ibm block unblock lcase ucase swab noerror sync)/,'	\
	'c/*=/x:<number>/'								\
	'n/*/(if of conv ibs obs bs cbs files skip file seek count)/='

complete defaults							\
	'c/-/(currentHost host)/'					\
	'n/-host/`list_all_hostnames`/'					\
	'n/read/`defaults domains`/'					\
	'n/read-type/`defaults domains`/'				\
	'n/write/`defaults domains`/'					\
	'n/rename/`defaults domains`/'					\
	'n/delete/`defaults domains`/'					\
	'p/1/(read read-type write rename delete domains find help)/'

complete find							\
	'n/-fstype/(nfs 4.2)/'					\
	'n/-name/f/' 'n/-user/u/' 'n/-group/g/'			\
	'n/-type/(c b d f p l s)/'				\
	'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/'

if (! $?framework_path) then
    set framework_path = ()

    foreach dir (				\
		/Network/Library/Frameworks	\
		/Local/Library/Frameworks	\
		/Library/Frameworks		\
		/System/Library/Frameworks	\
		/LocalLibrary/Frameworks	\
		/NextLibrary/Frameworks		\
		~/Library/Frameworks		\
		)
	if ( -d "${dir}" ) set framework_path = ( ${framework_path} "${dir}" )
    end
endif

complete {gcc,g++,cc,c++}							\
	'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 ramework)/'	\
	'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@-l@`ls -1 /usr/lib/lib* | sed s%^.\*/lib%%\;s%\\..\*\$%% | uniq`@'	\
	'c/-/(f W vspec v vpath ansi traditional traditional-cpp trigraphs	\
		pedantic x o l c g L I D U O O2 O3 C E H B b V M MD MM i	\
		dynamic nodtdlib static nostdinc undef arch framework)/'	\
	'n@-framework@`ls -1 ${framework_path} | grep .framework\$ | sed 's/\\.framework//' | uniq`@' \
	'n/-arch/(ppc i386)/'							\
	'n/*/f:*.{c,C,cc,m,o,a,s,i}/'

complete gdb	'c/-cd=/d/'								\
		'n/-b/n/'								\
		'c@-tty=@`ls -1 /dev/tty*`@'						\
		'c/-symbols=/f/'   'n/-s/f/'						\
		'c/-exec=/c/'      'n/-e/c/' 'n/-se/c/'					\
		'c/-command=/f/'   'n/-x/f/'						\
		'c/-core=/f/'      'n/-c/f/'						\
		'c/-directory=/d/' 'n/-d/d/'						\
		'c/-/(help nx n q batch b s se write e c x d quiet q fullname f)/'

complete javac	'n/*/f:*.java/'

complete nicl	'c/-/(ro p u P raw t q x500					\
			read create delete rename list append merge insert	\
			move copy search path setrdn history stats domainname	\
			rparent resync auth refs)/'				\
		'n/-u/u/' 'n/-auth/u/' 'n/-P/n/'				\
		'n/-raw/d/'

##
# Read user's completions
##
if (-r "${tcsh_initdir}/completions.mine") then
  source "${tcsh_initdir}/completions.mine"
endif