Commit | Line | Data |
---|---|---|
362bc2da DL |
1 | .\" Copyright (c) 1992 Free Software Foundation |
2 | .\" See section COPYING for conditions for redistribution | |
3 | .TH etags 1 "19apr1994" "GNU Tools" "GNU Tools" | |
4 | .de BP | |
5 | .sp | |
6 | .ti -.2i | |
7 | \(** | |
8 | .. | |
9 | ||
10 | .SH NAME | |
11 | etags, ctags \- generate tag file for Emacs, vi | |
12 | .SH SYNOPSIS | |
13 | .hy 0 | |
14 | .na | |
15 | .B etags [\|\-aCDRSVh\|] [\|\-i \fIfile\fP\|] [\|\-l \fIlanguage\fP\|] [\|\-i \fIregexp\fP\|] [\|\-o \fItagfile\fP\|] | |
16 | .br | |
17 | [\|\-\-c++\|] [\|\-\-no\-defines\|] [\|\-\-ignore\-indentation\|] | |
18 | [\|\-\-language=\fIlanguage\fP\|] [\|\-\-regex=\fIregexp\fP\|] | |
19 | [\|\-\-no\-regexp\|] [\|\-\-help\|] [\|\-\-version\|] | |
20 | [\|\-\-include=\fIfile\fP\|] [\|\-\-output=\fItagfile\fP\|] | |
21 | [\|\-\-append\|] \fIfile\fP .\|.\|. | |
22 | ||
23 | .B ctags [\|\-aCdRSVh\|] [\|\-BtTuvwx\|] [\|\-l \fIlanguage\fP\|] | |
24 | .br | |
25 | [\|\-i \fIregexp\fP\|] [\|\-o \fItagfile\fP\|] | |
26 | [\|\-\-c++\|] [\|\-\-defines\|] [\|\-\-ignore\-indentation\|] | |
27 | [\|\-\-no\-warn\|] [\|\-\-cxref\|] [\|\-\-backward\-search\|] | |
28 | [\|\-\-forward\-search\|] [\|\-\-typedefs\|] [\|\-\-typedefs\-and\-c++\|] | |
29 | [\|\-\-language=\fIlanguage\fP\|] [\|\-\-regex=\fIregexp\fP\|] | |
30 | [\|\-\-help\|] [\|\-\-version\|] | |
31 | .br | |
32 | [\|\-\-output=\fItagfile\fP\|] [\|\-\-append\|] [\|\-\-update\|] \fIfile\fP .\|.\|. | |
33 | .ad b | |
34 | .hy 1 | |
35 | .SH DESCRIPTION | |
36 | The `\|\fBetags\fP\|' program is used to create a tag table file, in a format | |
37 | understood by | |
38 | .BR emacs ( 1 )\c | |
39 | \&; the `\|\fBctags\fP\|' program is used to create a similar table in a | |
40 | format understood by | |
41 | .BR vi ( 1 )\c | |
42 | \&. Both forms of the program understand | |
43 | the syntax of C, Objective C, C++, Java, Fortran, Pascal, Cobol, | |
44 | LaTeX, Scheme, Emacs Lisp/Common Lisp, Postscript, Erlang, Prolog and | |
45 | most assembler\-like syntaxes. | |
46 | Both forms read the files specified on the command line, and write a tag | |
47 | table (defaults: `\|TAGS\|' for \fBetags\fP, `\|tags\|' for | |
48 | \fBctags\fP) in the current working directory. | |
49 | Files specified with relative file names will be recorded in the tag | |
50 | table with file names relative to the directory where the tag table | |
51 | resides. Files specified with absolute file names will be recorded | |
52 | with absolute file names. | |
53 | The programs recognize the language used in an input file based on its | |
54 | file name and contents. The --language switch can be used to force | |
55 | parsing of the file names following the switch according to the given | |
56 | language, overriding guesses based on filename extensions. | |
57 | .SH OPTIONS | |
58 | Some options make sense only for the \fBvi\fP style tag files produced | |
59 | by ctags; | |
60 | \fBetags\fP does not recognize them. | |
61 | The programs accept unambiguous abbreviations for long option names. | |
62 | .TP | |
63 | .B \-a, \-\-append | |
64 | Append to existing tag file. (For vi-format tag files, see also | |
65 | \fB\-\-update\fP.) | |
66 | .TP | |
67 | .B \-B, \-\-backward\-search | |
68 | Tag files written in the format expected by \fBvi\fP contain regular | |
69 | expression search instructions; the \fB\-B\fP option writes them using | |
70 | the delimiter `\|\fB?\fP\|', to search \fIbackwards\fP through files. | |
71 | The default is to use the delimiter `\|\fB/\fP\|', to search \fIforwards\fP | |
72 | through files. | |
73 | Only \fBctags\fP accepts this option. | |
74 | .TP | |
75 | .B \-C, \-\-c++ | |
76 | Treat files with `\|.c\|' and `\|.h\|' extensions as C++ code, not C | |
77 | code. Files with `\|.C\|', `\|.H\|', `\|.cxx\|', `\|.hxx\|', or | |
78 | `\|.cc\|' extensions are always assumed to be C++ code. | |
79 | .TP | |
80 | .B \-d, \-\-defines | |
81 | Create tag entries for C preprocessor constant definitions | |
82 | and enum constants, too. This is the | |
83 | default behavior for \fBetags\fP, so this option is only accepted | |
84 | by \fBctags\fP. | |
85 | .TP | |
86 | .B \-D, \-\-no\-defines | |
87 | Do not create tag entries for C preprocessor constant definitions | |
88 | and enum constants. | |
89 | This may make the tags file much smaller if many header files are tagged. | |
90 | This is the default behavior for \fBctags\fP, so this option is only | |
91 | accepted by \fBetags\fP. | |
92 | .TP | |
93 | \fB\-l\fP \fIlanguage\fP, \fB\-\-language=\fIlanguage\fP | |
94 | Parse the following files according to the given language. More than | |
95 | one such options may be intermixed with filenames. Use \fB\-\-help\fP | |
96 | to get a list of the available languages and their default filename | |
97 | extensions. The `auto' language can be used to restore automatic | |
98 | detection of language based on filename extension. The `none' | |
99 | language may be used to disable language parsing altogether; only | |
100 | regexp matching is done in this case (see the \fB\-\-regex\fP option). | |
101 | .TP | |
102 | \fB\-\-no_globals\fP | |
103 | Do not tag global variables in C, C++, Objective C, Java. Typically | |
104 | this reduces the file size by one fourth. | |
105 | .TP | |
106 | \fB\-\-members\fP | |
107 | Tag variables that are members of strucure-like constructs in C++, | |
108 | Objective C, Java. | |
109 | .TP | |
110 | \fB\-o\fP \fItagfile\fP, \fB\-\-output=\fItagfile\fP | |
111 | Explicit name of file for tag table; overrides default `\|TAGS\|' or | |
112 | `\|tags\|'. (But ignored with \fB\-v\fP or \fB\-x\fP.) | |
113 | .TP | |
114 | \fB\-r\fP \fIregexp\fP, \fB\-\-regex=\fIregexp\fP | |
115 | Make tags based on regexp matching for each line of the files | |
116 | following this option, in addition to the tags made with the standard | |
117 | parsing based on language. May be freely intermixed with filenames | |
118 | and the \fB\-R\fP option. The regexps are cumulative, i.e. each | |
119 | option will add to the previous ones. The regexps are of the form: | |
120 | .br | |
121 | ||
122 | \fB/\fP\fItagregexp\fP[\fB/\fP\fInameregexp\fP]\fB/\fP | |
123 | .br | |
124 | ||
125 | where \fItagregexp\fP is used to match the lines that must be tagged. | |
126 | It should not match useless characters. If the match is | |
127 | such that more characters than needed are unavoidably matched by | |
128 | \fItagregexp\fP, it may be useful to add a \fInameregexp\fP, to | |
129 | narrow down the tag scope. \fBctags\fP ignores regexps without a | |
130 | \fInameregexp\fP. The syntax of regexps is the same as in emacs, | |
131 | augmented with intervals of the form \\{m,n\\}, as id ed or grep. | |
132 | .br | |
133 | Here are some examples. All the regexps are quoted to protect them | |
134 | from shell interpretation. | |
135 | .br | |
136 | ||
137 | Tag the DEFVAR macros in the emacs source files: | |
138 | .br | |
139 | \fI\-\-regex\='/[ \\t]*DEFVAR_[A-Z_ \\t(]+"\\([^"]+\\)"\/'\fP | |
140 | .br | |
141 | ||
142 | Tag VHDL files (this example is a single long line, broken here for | |
143 | formatting reasons): | |
144 | .br | |
145 | \fI\-\-language\=none\ \-\-regex='/[\ \\t]*\\(ARCHITECTURE\\|\\ | |
146 | CONFIGURATION\\)\ +[^\ ]*\ +OF/'\ \-\-regex\='/[\ \\t]*\\ | |
147 | \\(ATTRIBUTE\\|ENTITY\\|FUNCTION\\|PACKAGE\\(\ BODY\\)?\\ | |
148 | \\|PROCEDURE\\|PROCESS\\|TYPE\\)[\ \\t]+\\([^\ \\t(]+\\)/\\3/'\fP | |
149 | .br | |
150 | ||
151 | Tag TCL files (this last example shows the usage of a \fItagregexp\fP): | |
152 | .br | |
153 | \fI\-\-lang\=none \-\-regex\='/proc[\ \\t]+\\([^\ \\t]+\\)/\\1/'\fP | |
154 | ||
155 | .TP | |
156 | .B \-R, \-\-no\-regex | |
157 | Don't do any more regexp matching on the following files. May be | |
158 | freely intermixed with filenames and the \fB\-\-regex\fP option. | |
159 | .TP | |
160 | .B \-S, \-\-ignore\-indentation | |
161 | Don't rely on indentation as much as we normally do. Currently, this | |
162 | means not to assume that a closing brace in the first column is the | |
163 | final brace of a function or structure definition in C and C++. | |
164 | .TP | |
165 | .B \-t, \-\-typedefs | |
166 | Record typedefs in C code as tags. Since this is the default behaviour | |
167 | of \fBetags\fP, only \fBctags\fP accepts this option. | |
168 | .TP | |
169 | .B \-T, \-\-typedefs\-and\-c++ | |
170 | Generate tag entries for typedefs, struct, enum, and union tags, and | |
171 | C++ member functions. Since this is the default behaviour | |
172 | of \fBetags\fP, only \fBctags\fP accepts this option. | |
173 | .TP | |
174 | .B \-u, \-\-update | |
175 | Update tag entries for \fIfiles\fP specified on command line, leaving | |
176 | tag entries for other files in place. Currently, this is implemented | |
177 | by deleting the existing entries for the given files and then | |
178 | rewriting the new entries at the end of the tags file. It is often | |
179 | faster to simply rebuild the entire tag file than to use this. | |
180 | Only \fBctags\fP accepts this option. | |
181 | .TP | |
182 | .B \-v, \-\-vgrind | |
183 | Instead of generating a tag file, write index (in \fBvgrind\fP format) | |
184 | to standard output. Only \fBctags\fP accepts this option. | |
185 | .TP | |
186 | .B \-w, \-\-no\-warn | |
187 | Suppress warning messages about duplicate entries. The \fBetags\fP | |
188 | program does not check for duplicate entries, so this option is not | |
189 | allowed with it. | |
190 | .TP | |
191 | .B \-x, \-\-cxref | |
192 | Instead of generating a tag file, write a cross reference (in | |
193 | \fBcxref\fP format) to standard output. Only \fBctags\fP accepts this option. | |
194 | .TP | |
195 | .B \-H, \-\-help | |
196 | Print usage information. | |
197 | .TP | |
198 | .B \-V, \-\-version | |
199 | Print the current version of the program (same as the version of the | |
200 | emacs \fBetags\fP is shipped with). | |
201 | ||
202 | .SH "SEE ALSO" | |
203 | `\|\fBemacs\fP\|' entry in \fBinfo\fP; \fIGNU Emacs Manual\fP, Richard | |
204 | Stallman. | |
205 | .br | |
206 | .BR cxref ( 1 ), | |
207 | .BR emacs ( 1 ), | |
208 | .BR vgrind ( 1 ), | |
209 | .BR vi ( 1 ). | |
210 | ||
211 | .SH COPYING | |
212 | Copyright (c) 1992 Free Software Foundation, Inc. | |
213 | .PP | |
214 | Permission is granted to make and distribute verbatim copies of | |
215 | this manual provided the copyright notice and this permission notice | |
216 | are preserved on all copies. | |
217 | .PP | |
218 | Permission is granted to copy and distribute modified versions of this | |
219 | manual under the conditions for verbatim copying, provided that the | |
220 | entire resulting derived work is distributed under the terms of a | |
221 | permission notice identical to this one. | |
222 | .PP | |
223 | Permission is granted to copy and distribute translations of this | |
224 | manual into another language, under the above conditions for modified | |
225 | versions, except that this permission notice may be included in | |
226 | translations approved by the Free Software Foundation instead of in | |
227 | the original English. |