Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _global and _global_tags
- X-seq: zsh-workers 17476
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: _global and _global_tags
- Date: Mon, 22 Jul 2002 17:28:32 -0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Courtesy of Matt Zimmerman, here is completion for GNU GLOBAL.
Apparently _global_tags will be useful when someone gets around to
writing _less.
Index: Completion/Unix/Command/.distfiles
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/.distfiles,v
retrieving revision 1.26
diff -u -r1.26 .distfiles
--- Completion/Unix/Command/.distfiles 17 Jun 2002 13:29:24 -0000 1.26
+++ Completion/Unix/Command/.distfiles 22 Jul 2002 21:24:03 -0000
@@ -18,4 +18,5 @@
_user_admin _rsync _arping _spamassassin _mtools _ifconfig
_fsh _chkconfig _cdcd _irssi _mysqldiff _sccs
_netcat _larch _valgrind _texinfo _figlet
+_global _global_tags
'
Index: Completion/Unix/Command/_global
===================================================================
RCS file: Completion/Unix/Command/_global
diff -N Completion/Unix/Command/_global
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Completion/Unix/Command/_global 22 Jul 2002 21:24:04 -0000
@@ -0,0 +1,45 @@
+#compdef global
+
+_arguments \
+ '(--completion)-c[completion on prefix]:prefix:' \
+ '(-c)--completion:prefix:' \
+ '(--file)-f[print function definitions in file]' \
+ '(-f)--file' \
+ '(--grep)-g[print all lines which match pattern using grep]:pattern' \
+ '(-g)--grep' \
+ '(--idutils)-I[print all lines which match pattern using id-utils]:pattern' \
+ '(-I)--idutils' \
+ '(--print-dbpath)-p[print location of GTAGS]' \
+ '(-p)--print-dbpath' \
+ '(--path)-P[print paths matching pattern]:pattern:' \
+ '(-P)--path' \
+ '(--update)-u[locate tag files and update incrementally]' \
+ '(-u)--update' \
+ '(--absolute)-a[Print absolute path names]' \
+ '(-a)--absolute' \
+ '(--ignore-case)-i[ignore case in patterns]' \
+ '(-i)--ignore-case' \
+ '(--local)-l[Print just objects which exist under the current directory]' \
+ '(-l)--local' \
+ '(--nofilter)-n[Suppress sort filter and path conversion filter]' \
+ '(-n)--nofilter' \
+ '(--other)-o[Search in other files, not just source files (with -g)]' \
+ '(-o)--other' \
+ '(--quiet)-q[Quiet mode]' \
+ '(-q)--quiet' \
+ '(--reference --rootdir)-r[Find object references instead of definitions]' \
+ '(-r --rootdir)--rereference' \
+ '(-r --reference)--rootdir' \
+ '(--symbol)-s[Find symbols instead of function names]:pattern:' \
+ '(-s)--symbol' \
+ '(--tags)-t[Output in standard ctags format]' \
+ '(-t)--tags' \
+ '(--through -s -r -l)-T[Search through all tag files in GTAGSLIBPATH]' \
+ '(-T -s -r -l)--through' \
+ '(--verbose)-v[Verbose mode]' \
+ '(-v)--verbose' \
+ '(--cxref)-x[In addition to default output, list line number and contents]' \
+ '(-x)--cxref' \
+ '--version:show version number:' \
+ '--help:show help:' \
+ ':word:_global_tags'
Index: Completion/Unix/Command/_global_tags
===================================================================
RCS file: Completion/Unix/Command/_global_tags
diff -N Completion/Unix/Command/_global_tags
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Completion/Unix/Command/_global_tags 22 Jul 2002 21:24:04 -0000
@@ -0,0 +1,9 @@
+#autoload
+
+local globalresults
+
+[[ -z $words[CURRENT] ]] && return 1
+
+globalresults=($(global --completion $words[CURRENT]))
+
+compadd -M 'm:{a-zA-Z}={A-Za-z}' -a "$@" - globalresults
Messages sorted by:
Reverse Date,
Date,
Thread,
Author