From owner-svn-src-head@FreeBSD.ORG Tue Oct 16 02:52:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 169EDAC6; Tue, 16 Oct 2012 02:52:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC3B28FC0C; Tue, 16 Oct 2012 02:52:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9G2qUe2028639; Tue, 16 Oct 2012 02:52:30 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9G2qUTs028637; Tue, 16 Oct 2012 02:52:30 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210160252.q9G2qUTs028637@svn.freebsd.org> From: Eitan Adler Date: Tue, 16 Oct 2012 02:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241602 - head/share/examples/csh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2012 02:52:31 -0000 Author: eadler Date: Tue Oct 16 02:52:30 2012 New Revision: 241602 URL: http://svn.freebsd.org/changeset/base/241602 Log: Add a bunch more example completions. Submitted by: wblock Approved by: cperciva (implicit) MFC after: 3 days Modified: head/share/examples/csh/dot.cshrc Modified: head/share/examples/csh/dot.cshrc ============================================================================== --- head/share/examples/csh/dot.cshrc Tue Oct 16 01:37:17 2012 (r241601) +++ head/share/examples/csh/dot.cshrc Tue Oct 16 02:52:30 2012 (r241602) @@ -25,29 +25,99 @@ bindkey "^[[3~" delete-char-or-list-or-e # Make the Ins key work bindkey "\e[2~" overwrite-mode -# Aliases used for completions -alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1' -alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r | cut -d . -f 1`&& pkg_info -E \*' - # Some common completions +complete cd 'p/1/d/' complete chown 'p/1/u/' complete dd 'c/[io]f=/f/ n/*/"(if of ibs obs bs skip seek count)"/=' +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 fg 'c/%/j/' +complete gpart 'p/1/(add backup bootcode commit create delete destroy modify recover resize restore set show undo unset)/' \ + 'n/add/x:-t type [-a alignment] [-b start] [-s size] [-i index] [-l label] -f flags geom/' \ + 'n/backup/x:geom/' \ + 'n/bootcode/x:[-b bootcode] [-p partcode -i index] [-f flags] geom/' \ + 'n/commit/x:geom/' \ + 'n/create/x:-s scheme [-n entries] [-f flags] provider/' \ + 'n/delete/x:-i index [-f flags] geom/' \ + 'n/destroy/x:[-F] [-f flags] geom/' \ + 'n/modify/x:-i index [-l label] [-t type] [-f flags] geom/' \ + 'n/recover/x:[-f flags] geom/' \ + 'n/resize/x:-i index [-a alignment] [-s size] [-f flags] geom/' \ + 'n/restore/x:[-lF] [-f flags] provider [...]/' \ + 'n/set/x:-a attrib -i index [-f flags] geom/' \ + 'n/show/x:[-l | -r] [-p] [geom ...]/' \ + 'n/undo/x:geom/' \ + 'n/unset/x:-a attrib -i index [-f flags] geom/' +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:/ N/-*e/f/' \ + 'n/-*e/x:/' \ + 'n/-*f/f/' \ + 'n/*/f/' +complete ifconfig 'p@1@`ifconfig -l`@' \ + 'n/*/(range phase link netmask mtu vlandev vlan metric mediaopt down delete broadcast arp debug)/' + 'c/%/j/' \ + 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' complete killall 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/' -complete kldunload 'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name` @' -complete make 'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@' -complete man 'C/*/c/' +complete kldload 'n@*@`ls -1 /boot/modules/ /boot/kernel/ | awk -F/ \$NF\ \~\ \".ko\"\ \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\}`@' +complete kldunload 'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name`@' +complete make 'p@1@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@' \ + 'n@-V@`make -ndv | & grep Global: | sed -E -e "s/^Global://" -e "s/ .*//" -e "/^[[:lower:]]/d" | sort | uniq`@' +complete man 'C/*/c/' +complete netstat 'n@-I@`ifconfig -l`@' complete pkg_delete 'c/-/(i v D n p d f G x X r)/' 'n@*@`ls /var/db/pkg`@' complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed s%/var/db/pkg/%%`@' -complete portmaster 'c/--/(always-fetch check-depends check-port-dbdir clean-distfiles \ - clean-packages delete-build-only delete-packages force-config help \ - index index-first index-only list-origins local-packagedir no-confirm \ - no-index-fetch no-term-title packages packages-build packages-if-newer \ - packages-local packages-only show-work update-if-newer version)/' \ - 'c/-/(a b B C d D e f F g G h H i l L m n o p r R s t u v w x)/' \ - 'n@*@`_PKGS_PkGs_PoRtS_`@' +complete ping 'p/1/$hosts/' +complete pkill 'c/-/S/' \ + 'n@*@`ps -axc -o command="" | sort | uniq`@' +complete portmaster 'c/--/(always-fetch check-depends check-port-dbdir clean-distfiles clean-packages delete-build-only \ + delete-packages force-config help index index-first index-only list-origins local-packagedir \ + no-confirm no-index-fetch no-term-title packages packages-build packages-if-newer packages-local \ + packages-only show-work update-if-newer version)/' \ + 'c/-/(a b B C d D e f F g G h H i l L m n o p r R s t u v w x)/' \ + 'n@*@`pkg_info -E \*`@' +complete rsync "c,*:/,F:/," \ + "c,*:,F:$HOME," \ + 'c/*@/$hosts/:/' +complete scp "c,*:/,F:/," \ + "c,*:,F:$HOME," \ + 'c/*@/$hosts/:/' complete service 'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop reload restart status rcvar onestart onestop)/' +complete svn 'C@file:///@`'"${HOME}/etc/tcsh/complete.d/svn"'`@@' \ + 'n@ls@(file:/// svn+ssh:// svn://)@@' \ + 'n@help@(add blame cat checkout cleanup commit copy delete export help import info list ls lock log merge mkdir move propdel \ + propedit propget proplist propset resolved revert status switch unlock update)@' 'p@1@(add blame cat checkout cleanup commit \ + copy delete export help import info list ls lock log merge mkdir move propdel propedit propget proplist propset resolved \ + revert status switch unlock update)@' +complete ssh 'p/1/$hosts/' \ + 'c/-/(l n)/' \ + 'n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/' complete sysctl 'n/*/`sysctl -Na`/' +complete tmux 'n/*/(attach detach has kill-server kill-session lsc lscm ls lockc locks new refresh rename showmsgs source start suspendc switchc)/' +complete which 'C/*/c/' + +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/' +endif # Alternate prompts set prompt = '#'