1 .\" Copyright (c) 1992 Free Software Foundation
2 .\" See section COPYING for conditions for redistribution
3 .TH etags 1 "19apr1994" "GNU Tools" "GNU Tools"
11 etags, ctags \- generate tag file for Emacs, vi
15 .B etags [\|\-aCDRSVh\|] [\|\-i \fIfile\fP\|] [\|\-l \fIlanguage\fP\|] [\|\-i \fIregexp\fP\|] [\|\-o \fItagfile\fP\|]
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 .\|.\|.
23 .B ctags [\|\-aCdRSVh\|] [\|\-BtTuvwx\|] [\|\-l \fIlanguage\fP\|]
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\|]
32 [\|\-\-output=\fItagfile\fP\|] [\|\-\-append\|] [\|\-\-update\|] \fIfile\fP .\|.\|.
36 The `\|\fBetags\fP\|' program is used to create a tag table file, in a format
39 \&; the `\|\fBctags\fP\|' program is used to create a similar table in a
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.
58 Some options make sense only for the \fBvi\fP style tag files produced
60 \fBetags\fP does not recognize them.
61 The programs accept unambiguous abbreviations for long option names.
64 Append to existing tag file. (For vi-format tag files, see also
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
73 Only \fBctags\fP accepts this option.
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.
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
86 .B \-D, \-\-no\-defines
87 Do not create tag entries for C preprocessor constant definitions
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.
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).
103 Do not tag global variables in C, C++, Objective C, Java. Typically
104 this reduces the file size by one fourth.
107 Tag variables that are members of strucure-like constructs in C++,
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.)
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:
122 \fB/\fP\fItagregexp\fP[\fB/\fP\fInameregexp\fP]\fB/\fP
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.
133 Here are some examples. All the regexps are quoted to protect them
134 from shell interpretation.
137 Tag the DEFVAR macros in the emacs source files:
139 \fI\-\-regex\='/[ \\t]*DEFVAR_[A-Z_ \\t(]+"\\([^"]+\\)"\/'\fP
142 Tag VHDL files (this example is a single long line, broken here for
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
151 Tag TCL files (this last example shows the usage of a \fItagregexp\fP):
153 \fI\-\-lang\=none \-\-regex\='/proc[\ \\t]+\\([^\ \\t]+\\)/\\1/'\fP
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.
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++.
166 Record typedefs in C code as tags. Since this is the default behaviour
167 of \fBetags\fP, only \fBctags\fP accepts this option.
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.
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.
183 Instead of generating a tag file, write index (in \fBvgrind\fP format)
184 to standard output. Only \fBctags\fP accepts this option.
187 Suppress warning messages about duplicate entries. The \fBetags\fP
188 program does not check for duplicate entries, so this option is not
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.
196 Print usage information.
199 Print the current version of the program (same as the version of the
200 emacs \fBetags\fP is shipped with).
203 `\|\fBemacs\fP\|' entry in \fBinfo\fP; \fIGNU Emacs Manual\fP, Richard
212 Copyright (c) 1992 Free Software Foundation, Inc.
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.
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.
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.