cosmopolitan/third_party/ctags/README.txt

1196 lines
65 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

CTAGS(1) Exuberant Ctags CTAGS(1)
๐๐€๐Œ๐„
ctags - Generate tag files for source code
๐’๐˜๐๐Ž๐๐’๐ˆ๐’
๐—ฐ๐˜๐—ฎ๐—ด๐˜€ [๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐˜€] [fฬฒiฬฒlฬฒeฬฒ(ฬฒsฬฒ)ฬฒ]
๐—ฒ๐˜๐—ฎ๐—ด๐˜€ [๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐˜€] [fฬฒiฬฒlฬฒeฬฒ(ฬฒsฬฒ)ฬฒ]
๐ƒ๐„๐’๐‚๐‘๐ˆ๐๐“๐ˆ๐Ž๐
The ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ and ๐—ฒ๐˜๐—ฎ๐—ด๐˜€ programs (hereinafter collectively referred
to as ๐—ฐ๐˜๐—ฎ๐—ด๐˜€, except where distinguished) generate an index (or
"tag") file for a variety of language objects found in fฬฒiฬฒlฬฒeฬฒ(ฬฒsฬฒ)ฬฒ.
This tag file allows these items to be quickly and easily located
by a text editor or other utility. A "tag" signifies a language
object for which an index entry is available (or, alternatively,
the index entry created for that object).
Alternatively, ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ can generate a cross reference file which
lists, in human readable form, information about the various
source objects found in a set of language files.
Tag index files are supported by numerous editors, which allow
the user to locate the object associated with a name appearing in
a source file and jump to the file and line which defines the
name. Those known about at the time of this release are:
๐•๐—ถ(1) and its derivatives (e.g. Elvis, Vim, Vile, Lemmy),
๐‚๐‘๐—ถ๐’๐, ๐„๐—บ๐—ฎ๐—ฐ๐˜€, ๐…๐“๐„ (Folding Text Editor), ๐‰๐„๐ƒ, ๐—ท๐„๐—ฑ๐—ถ๐˜, ๐Œ๐—ถ๐—ป๐—ฒ๐—ฑ,
๐๐„๐—ฑ๐—ถ๐˜ (Nirvana Edit), ๐“๐’๐„ (The SemWare Editor), ๐”๐—น๐˜๐—ฟ๐—ฎ๐„๐—ฑ๐—ถ๐˜,
๐–๐—ผ๐—ฟ๐—ธ๐’๐—ฝ๐—ฎ๐—ฐ๐—ฒ, ๐—๐Ÿฎ, ๐™๐—ฒ๐˜‚๐˜€
๐‚๐˜๐—ฎ๐—ด๐˜€ is capable of generating different kinds of tags for each
of many different languages. For a complete list of supported
languages, the names by which they are recognized, and the kinds
of tags which are generated for each, see the --๐—น๐—ถ๐˜€๐˜-๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ๐˜€
and --๐—น๐—ถ๐˜€๐˜-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€ options.
๐’๐Ž๐”๐‘๐‚๐„ ๐…๐ˆ๐‹๐„๐’
Unless the --๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ-๐—ณ๐—ผ๐—ฟ๐—ฐ๐—ฒ option is specified, the language of
each source file is automatically selected based upon a mapping
of file names to languages. The mappings in effect for each lanโ€
guage may be display using the --๐—น๐—ถ๐˜€๐˜-๐—บ๐—ฎ๐—ฝ๐˜€ option and may be
changed using the --๐—น๐—ฎ๐—ป๐—ด๐—บ๐—ฎ๐—ฝ option. On platforms which support
it, if the name of a file is not mapped to a language and the
file is executable, the first line of the file is checked to see
if the file is a "#!" script for a recognized language.
By default, all other files names are ignored. This permits runโ€
ning ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ on all files in either a single directory (e.g. "ctags
*"), or on all files in an entire source directory tree (e.g.
"ctags -R"), since only those files whose names are mapped to
languages will be scanned.
[The reason that .h extensions are mapped to C++ files rather
than C files is because it is common to use .h extensions in C++,
and no harm results in treating them as C++ files.]
๐Ž๐๐“๐ˆ๐Ž๐๐’
Despite the wealth of available options, defaults are set so that
๐—ฐ๐˜๐—ฎ๐—ด๐˜€ is most commonly executed without any options (e.g. "ctags
*", or "ctags -R"), which will create a tag file in the current
directory for all recognized source files. The options described
below are provided merely to allow custom tailoring to meet speโ€
cial needs.
Note that spaces separating the single-letter options from their
parameters are optional.
Note also that the boolean parameters to the long form options
(those beginning with "--" and that take a "[ฬฒ=ฬฒyฬฒeฬฒsฬฒ|nฬฒoฬฒ]ฬฒ" parameter)
may be omitted, in which case "=yฬฒeฬฒsฬฒ" is implied. (e.g. --๐˜€๐—ผ๐—ฟ๐˜ is
equivalent to --๐˜€๐—ผ๐—ฟ๐˜=yฬฒeฬฒsฬฒ). Note further that "=1ฬฒ" and "=oฬฒnฬฒ" are
considered synonyms for "=yฬฒeฬฒsฬฒ", and that "=0ฬฒ" and "=oฬฒfฬฒfฬฒ" are conโ€
sidered synonyms for "=nฬฒoฬฒ".
Some options are either ignored or useful only when used while
running in etags mode (see -๐—ฒ option). Such options will be
noted.
Most options may appear anywhere on the command line, affecting
only those files which follow the option. A few options, however,
must appear before the first file name and will be noted as such.
Options taking language names will accept those names in either
upper or lower case. See the --๐—น๐—ถ๐˜€๐˜-๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ๐˜€ option for a comโ€
plete list of the built-in language names.
-๐—ฎ Equivalent to --๐—ฎ๐—ฝ๐—ฝ๐—ฒ๐—ป๐—ฑ.
-๐ Use backward searching patterns (e.g. ?pattern?). [Ignored
in etags mode]
-๐—ฒ Enable etags mode, which will create a tag file for use with
the Emacs editor. Alternatively, if ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ is invoked by a
name containing the string "etags" (either by renaming, or
creating a link to, the executable), etags mode will be enโ€
abled. This option must appear before the first file name.
-๐—ณ tฬฒaฬฒgฬฒfฬฒiฬฒlฬฒeฬฒ
Use the name specified by tฬฒaฬฒgฬฒfฬฒiฬฒlฬฒeฬฒ for the tag file (default
is "tags", or "TAGS" when running in etags mode). If tฬฒaฬฒgฬฒfฬฒiฬฒlฬฒeฬฒ
is specified as "-", then the tag file is written to stanโ€
dard output instead. ๐‚๐˜๐—ฎ๐—ด๐˜€ will stubbornly refuse to take
orders if tฬฒaฬฒgฬฒfฬฒiฬฒlฬฒeฬฒ exists and its first line contains someโ€
thing other than a valid tags line. This will save your neck
if you mistakenly type "ctags -f *.c", which would otherwise
overwrite your first C file with the tags generated by the
rest! It will also refuse to accept a multi-character file
name which begins with a '-' (dash) character, since this
most likely means that you left out the tag file name and
this option tried to grab the next option as the file name.
If you really want to name your output tag file "-ugly",
specify it as "./-ugly". This option must appear before the
first file name. If this option is specified more than once,
only the last will apply.
-๐… Use forward searching patterns (e.g. /pattern/) (default).
[Ignored in etags mode]
-๐—ต lฬฒiฬฒsฬฒtฬฒ
Specifies a list of file extensions, separated by periods,
which are to be interpreted as include (or header) files. To
indicate files having no extension, use a period not folโ€
lowed by a non-period character (e.g. ".", "..x", ".x.").
This option only affects how the scoping of a particular
kinds of tags is interpreted (i.e. whether or not they are
considered as globally visible or visible only within the
file in which they are defined); it does not map the extenโ€
sion to any particular language. Any tag which is located in
a non-include file and cannot be seen (e.g. linked to) from
another file is considered to have file-limited (e.g.
static) scope. No kind of tag appearing in an include file
will be considered to have file-limited scope. If the first
character in the list is a plus sign, then the extensions in
the list will be appended to the current list; otherwise,
the list will replace the current list. See, also, the
--๐—ณ๐—ถ๐—น๐—ฒ-๐˜€๐—ฐ๐—ผ๐—ฝ๐—ฒ option. The default list is
".h.H.hh.hpp.hxx.h++.inc.def". To restore the default list,
specify -๐—ต dฬฒeฬฒfฬฒaฬฒuฬฒlฬฒtฬฒ. Note that if an extension supplied to
this option is not already mapped to a particular language
(see ๐’๐Ž๐”๐‘๐‚๐„ ๐…๐ˆ๐‹๐„๐’, above), you will also need to use either
the --๐—น๐—ฎ๐—ป๐—ด๐—บ๐—ฎ๐—ฝ or --๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ-๐—ณ๐—ผ๐—ฟ๐—ฐ๐—ฒ option.
-๐ˆ iฬฒdฬฒeฬฒnฬฒtฬฒiฬฒfฬฒiฬฒeฬฒrฬฒ-ฬฒlฬฒiฬฒsฬฒtฬฒ
Specifies a list of identifiers which are to be specially
handled while parsing C and C++ source files. This option is
specifically provided to handle special cases arising
through the use of preprocessor macros. When the identifiers
listed are simple identifiers, these identifiers will be igโ€
nored during parsing of the source files. If an identifier
is suffixed with a '+' character, ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ will also ignore any
parenthesis-enclosed argument list which may immediately
follow the identifier in the source files. If two identiโ€
fiers are separated with the '=' character, the first idenโ€
tifiers is replaced by the second identifiers for parsing
purposes. The list of identifiers may be supplied directly
on the command line or read in from a separate file. If the
first character of iฬฒdฬฒeฬฒnฬฒtฬฒiฬฒfฬฒiฬฒeฬฒrฬฒ-ฬฒlฬฒiฬฒsฬฒtฬฒ is '@', '.' or a pathname
separator ('/' or '\'), or the first two characters specify
a drive letter (e.g. "C:"), the parameter iฬฒdฬฒeฬฒnฬฒtฬฒiฬฒfฬฒiฬฒeฬฒrฬฒ-ฬฒlฬฒiฬฒsฬฒtฬฒ
will be interpreted as a filename from which to read a list
of identifiers, one per input line. Otherwise, iฬฒdฬฒeฬฒnฬฒtฬฒiฬฒโ€ฬฒ
fฬฒiฬฒeฬฒrฬฒ-ฬฒlฬฒiฬฒsฬฒtฬฒ is a list of identifiers (or identifier pairs) to
be specially handled, each delimited by a either a comma or
by white space (in which case the list should be quoted to
keep the entire list as one command line argument). Multiple
-๐ˆ options may be supplied. To clear the list of ignore
identifiers, supply a single dash ("-") for iฬฒdฬฒeฬฒnฬฒtฬฒiฬฒfฬฒiฬฒeฬฒrฬฒ-ฬฒlฬฒiฬฒsฬฒtฬฒ.
This feature is useful when preprocessor macros are used in
such a way that they cause syntactic confusion due to their
presence. Indeed, this is the best way of working around a
number of problems caused by the presence of syntax-busting
macros in source files (see ๐‚๐€๐•๐„๐€๐“๐’, below). Some examples
will illustrate this point.
int foo ARGDECL4(void *, ptr, long int, nbytes)
In the above example, the macro "ARGDECL4" would be mistakโ€
enly interpreted to be the name of the function instead of
the correct name of "foo". Specifying -๐ˆ AฬฒRฬฒGฬฒDฬฒEฬฒCฬฒLฬฒ4ฬฒ results in
the correct behavior.
/* creates an RCS version string in module */
MODULE_VERSION("$Revision: 750 $")
In the above example the macro invocation looks too much
like a function definition because it is not followed by a
semicolon (indeed, it could even be followed by a global
variable definition that would look much like a K&R style
function parameter declaration). In fact, this seeming funcโ€
tion definition could possibly even cause the rest of the
file to be skipped over while trying to complete the definiโ€
tion. Specifying -๐ˆ MฬฒOฬฒDฬฒUฬฒLฬฒEฬฒ_VฬฒEฬฒRฬฒSฬฒIฬฒOฬฒNฬฒ+ฬฒ would avoid such a probโ€
lem.
CLASS Example {
// your content here
};
The example above uses "CLASS" as a preprocessor macro which
expands to something different for each platform. For inโ€
stance CLASS may be defined as "class __declspec(dllexport)"
on Win32 platforms and simply "class" on UNIX. Normally,
the absence of the C++ keyword "class" would cause the
source file to be incorrectly parsed. Correct behavior can
be restored by specifying -๐ˆ CฬฒLฬฒAฬฒSฬฒSฬฒ=ฬฒcฬฒlฬฒaฬฒsฬฒsฬฒ.
-๐‹ fฬฒiฬฒlฬฒeฬฒ
Read from fฬฒiฬฒlฬฒeฬฒ a list of file names for which tags should be
generated. If fฬฒiฬฒlฬฒeฬฒ is specified as "-", then file names are
read from standard input. File names read using this option
are processed following file names appearing on the command
line. Options are also accepted in this input. If this opโ€
tion is specified more than once, only the last will apply.
๐๐—ผ๐˜๐—ฒ: fฬฒiฬฒlฬฒeฬฒ is read in line-oriented mode, where a new line
is the only delimiter and non-trailing white space is conโ€
sidered significant, in order that file names containing
spaces may be supplied (however, trailing white space is
stripped from lines); this can affect how options are parsed
if included in the input.
-๐—ป Equivalent to --๐—ฒ๐˜…๐—ฐ๐—บ๐—ฑ=nฬฒuฬฒmฬฒbฬฒeฬฒrฬฒ.
-๐ Equivalent to --๐—ฒ๐˜…๐—ฐ๐—บ๐—ฑ=pฬฒaฬฒtฬฒtฬฒeฬฒrฬฒnฬฒ.
-๐—ผ tฬฒaฬฒgฬฒfฬฒiฬฒlฬฒeฬฒ
Equivalent to -๐—ณ tฬฒaฬฒgฬฒfฬฒiฬฒlฬฒeฬฒ.
-๐‘ Equivalent to --๐—ฟ๐—ฒ๐—ฐ๐˜‚๐—ฟ๐˜€๐—ฒ.
-๐˜‚ Equivalent to --๐˜€๐—ผ๐—ฟ๐˜=nฬฒoฬฒ (i.e. "unsorted").
-๐• Equivalent to --๐˜ƒ๐—ฒ๐—ฟ๐—ฏ๐—ผ๐˜€๐—ฒ.
-๐˜„ This option is silently ignored for backward-compatibility
with the ctags of SVR4 Unix.
-๐˜… Print a tabular, human-readable cross reference (xref) file
to standard output instead of generating a tag file. The inโ€
formation contained in the output includes: the tag name;
the kind of tag; the line number, file name, and source line
(with extra white space condensed) of the file which defines
the tag. No tag file is written and all options affecting
tag file output will be ignored. Example applications for
this feature are generating a listing of all functions loโ€
cated in a source file (e.g. ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ -๐˜… --๐—ฐ-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€=fฬฒ fฬฒiฬฒlฬฒeฬฒ), or
generating a list of all externally visible global variables
located in a source file (e.g. ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ -๐˜… --๐—ฐ-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€=vฬฒ
--๐—ณ๐—ถ๐—น๐—ฒ-๐˜€๐—ฐ๐—ผ๐—ฝ๐—ฒ=nฬฒoฬฒ fฬฒiฬฒlฬฒeฬฒ). This option must appear before the
first file name.
--๐—ฎ๐—ฝ๐—ฝ๐—ฒ๐—ป๐—ฑ[=yฬฒeฬฒsฬฒ|nฬฒoฬฒ]
Indicates whether tags generated from the specified files
should be appended to those already present in the tag file
or should replace them. This option is off by default. This
option must appear before the first file name.
--๐—ฒ๐˜๐—ฎ๐—ด๐˜€-๐—ถ๐—ป๐—ฐ๐—น๐˜‚๐—ฑ๐—ฒ=fฬฒiฬฒlฬฒeฬฒ
Include a reference to fฬฒiฬฒlฬฒeฬฒ in the tag file. This option may
be specified as many times as desired. This supports Emacs'
capability to use a tag file which "includes" other tag
files. [Available only in etags mode]
--๐—ฒ๐˜…๐—ฐ๐—น๐˜‚๐—ฑ๐—ฒ=[pฬฒaฬฒtฬฒtฬฒeฬฒrฬฒnฬฒ]
Add pฬฒaฬฒtฬฒtฬฒeฬฒrฬฒnฬฒ to a list of excluded files and directories.
This option may be specified as many times as desired. For
each file name considered by ๐—ฐ๐˜๐—ฎ๐—ด๐˜€, each pฬฒaฬฒtฬฒtฬฒeฬฒrฬฒnฬฒ specified
using this option will be compared against both the complete
path (e.g. some/path/base.ext) and the base name (e.g.
base.ext) of the file, thus allowing patterns which match a
given file name irrespective of its path, or match only a
specific path. If appropriate support is available from the
runtime library of your C compiler, then pฬฒaฬฒtฬฒtฬฒeฬฒrฬฒnฬฒ may contain
the usual shell wildcards (not regular expressions) common
on Unix (be sure to quote the option parameter to protect
the wildcards from being expanded by the shell before being
passed to ๐—ฐ๐˜๐—ฎ๐—ด๐˜€; also be aware that wildcards can match the
slash character, '/'). You can determine if shell wildcards
are available on your platform by examining the output of
the --๐˜ƒ๐—ฒ๐—ฟ๐˜€๐—ถ๐—ผ๐—ป option, which will include "+wildcards" in the
compiled feature list; otherwise, pฬฒaฬฒtฬฒtฬฒeฬฒrฬฒnฬฒ is matched against
file names using a simple textual comparison.
If pฬฒaฬฒtฬฒtฬฒeฬฒrฬฒnฬฒ begins with the character '@', then the rest of
the string is interpreted as a file name from which to read
exclusion patterns, one per line. If pฬฒaฬฒtฬฒtฬฒeฬฒrฬฒnฬฒ is empty, the
list of excluded patterns is cleared. Note that at program
startup, the default exclude list contains "EIFGEN", "SCCS",
"RCS", and "CVS", which are names of directories for which
it is generally not desirable to descend while processing
the --๐—ฟ๐—ฒ๐—ฐ๐˜‚๐—ฟ๐˜€๐—ฒ option.
--๐—ฒ๐˜…๐—ฐ๐—บ๐—ฑ=tฬฒyฬฒpฬฒeฬฒ
Determines the type of EX command used to locate tags in the
source file. [Ignored in etags mode]
The valid values for tฬฒyฬฒpฬฒeฬฒ (either the entire word or the
first letter is accepted) are:
nฬฒuฬฒmฬฒbฬฒeฬฒrฬฒ Use only line numbers in the tag file for locating
tags. This has four advantages:
1. Significantly reduces the size of the resulting
tag file.
2. Eliminates failures to find tags because the
line defining the tag has changed, causing the
pattern match to fail (note that some editors,
such as ๐˜ƒ๐—ถ๐—บ, are able to recover in many such
instances).
3. Eliminates finding identical matching, but inโ€
correct, source lines (see ๐๐”๐†๐’, below).
4. Retains separate entries in the tag file for
lines which are identical in content. In pฬฒaฬฒtฬฒโ€ฬฒ
tฬฒeฬฒrฬฒnฬฒ mode, duplicate entries are dropped beโ€
cause the search patterns they generate are
identical, making the duplicate entries useโ€
less.
However, this option has one significant drawback:
changes to the source files can cause the line numโ€
bers recorded in the tag file to no longer correโ€
spond to the lines in the source file, causing
jumps to some tags to miss the target definition by
one or more lines. Basically, this option is best
used when the source code to which it is applied is
not subject to change. Selecting this option type
causes the following options to be ignored: -๐๐….
pฬฒaฬฒtฬฒtฬฒeฬฒrฬฒnฬฒ Use only search patterns for all tags, rather than
the line numbers usually used for macro definiโ€
tions. This has the advantage of not referencing
obsolete line numbers when lines have been added or
removed since the tag file was generated.
mฬฒiฬฒxฬฒeฬฒdฬฒ In this mode, patterns are generally used with a
few exceptions. For C, line numbers are used for
macro definition tags. This was the default format
generated by the original ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ and is, therefore,
retained as the default for this option. For Forโ€
tran, line numbers are used for common blocks beโ€
cause their corresponding source lines are generโ€
ally identical, making pattern searches useless for
finding all matches.
--๐—ฒ๐˜…๐˜๐—ฟ๐—ฎ=[ฬฒ+ฬฒ|ฬฒ-ฬฒ]ฬฒfฬฒlฬฒaฬฒgฬฒsฬฒ
Specifies whether to include extra tag entries for certain
kinds of information. The parameter fฬฒlฬฒaฬฒgฬฒsฬฒ is a set of one-
letter flags, each representing one kind of extra tag entry
to include in the tag file. If fฬฒlฬฒaฬฒgฬฒsฬฒ is preceded by either
the '+' or '-' character, the effect of each flag is added
to, or removed from, those currently enabled; otherwise the
flags replace any current settings. The meaning of each flag
is as follows:
fฬฒ Include an entry for the base file name of every
source file (e.g. "example.c"), which addresses the
first line of the file.
qฬฒ Include an extra class-qualified tag entry for each
tag which is a member of a class (for languages for
which this information is extracted; currently C++,
Eiffel, and Java). The actual form of the qualified
tag depends upon the language from which the tag was
derived (using a form that is most natural for how
qualified calls are specified in the language). For
C++, it is in the form "class::member"; for Eiffel
and Java, it is in the form "class.member". This may
allow easier location of a specific tags when multiโ€
ple occurrences of a tag name occur in the tag file.
Note, however, that this could potentially more than
double the size of the tag file.
--๐—ณ๐—ถ๐—ฒ๐—น๐—ฑ๐˜€=[ฬฒ+ฬฒ|ฬฒ-ฬฒ]ฬฒfฬฒlฬฒaฬฒgฬฒsฬฒ
Specifies the available extension fields which are to be inโ€
cluded in the entries of the tag file (see ๐“๐€๐† ๐…๐ˆ๐‹๐„ ๐…๐Ž๐‘๐Œ๐€๐“,
below, for more information). The parameter fฬฒlฬฒaฬฒgฬฒsฬฒ is a set
of one-letter flags, each representing one type of extension
field to include, with the following meanings (disabled by
default unless indicated):
aฬฒ Access (or export) of class members
fฬฒ File-restricted scoping [enabled]
iฬฒ Inheritance information
kฬฒ Kind of tag as a single letter [enabled]
Kฬฒ Kind of tag as full name
lฬฒ Language of source file containing tag
mฬฒ Implementation information
nฬฒ Line number of tag definition
sฬฒ Scope of tag definition [enabled]
Sฬฒ Signature of routine (e.g. prototype or parameter
list)
zฬฒ Include the "kind:" key in kind field
tฬฒ Type and name of a variable or typedef as "typeref:"
field [enabled]
Each letter or group of letters may be preceded by either
'+' to add it to the default set, or '-' to exclude it. In
the absence of any preceding '+' or '-' sign, only those
kinds explicitly listed in fฬฒlฬฒaฬฒgฬฒsฬฒ will be included in the
output (i.e. overriding the default set). This option is igโ€
nored if the option --๐—ณ๐—ผ๐—ฟ๐—บ๐—ฎ๐˜=1ฬฒ has been specified. The deโ€
fault value of this option is fฬฒkฬฒsฬฒtฬฒ.
--๐—ณ๐—ถ๐—น๐—ฒ-๐˜€๐—ฐ๐—ผ๐—ฝ๐—ฒ[=yฬฒeฬฒsฬฒ|nฬฒoฬฒ]
Indicates whether tags scoped only for a single file (i.e.
tags which cannot be seen outside of the file in which they
are defined, such as "static" tags) should be included in
the output. See, also, the -๐—ต option. This option is enabled
by default.
--๐—ณ๐—ถ๐—น๐˜๐—ฒ๐—ฟ[=yฬฒeฬฒsฬฒ|nฬฒoฬฒ]
Causes ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ to behave as a filter, reading source file
names from standard input and printing their tags to stanโ€
dard output on a file-by-file basis. If --๐˜€๐—ผ๐—ฟ๐˜๐—ฒ๐—ฑ is enabled,
tags are sorted only within the source file in which they
are defined. File names are read from standard input in
line-oriented input mode (see note for -๐‹ option) and only
after file names listed on the command line or from any file
supplied using the -๐‹ option. When this option is enabled,
the options -๐—ณ, -๐—ผ, and --๐˜๐—ผ๐˜๐—ฎ๐—น๐˜€ are ignored. This option is
quite esoteric and is disabled by default. This option must
appear before the first file name.
--๐—ณ๐—ถ๐—น๐˜๐—ฒ๐—ฟ-๐˜๐—ฒ๐—ฟ๐—บ๐—ถ๐—ป๐—ฎ๐˜๐—ผ๐—ฟ=sฬฒtฬฒrฬฒiฬฒnฬฒgฬฒ
Specifies a string to print to standard output following the
tags for each file name parsed when the --๐—ณ๐—ถ๐—น๐˜๐—ฒ๐—ฟ option is
enabled. This may permit an application reading the output
of ctags to determine when the output for each file is finโ€
ished. Note that if the file name read is a directory and
--๐—ฟ๐—ฒ๐—ฐ๐˜‚๐—ฟ๐˜€๐—ฒ is enabled, this string will be printed only once
at the end of all tags found for by descending the direcโ€
tory. This string will always be separated from the last tag
line for the file by its terminating newline. This option
is quite esoteric and is empty by default. This option must
appear before the first file name.
--๐—ณ๐—ผ๐—ฟ๐—บ๐—ฎ๐˜=lฬฒeฬฒvฬฒeฬฒlฬฒ
Change the format of the output tag file. Currently the only
valid values for lฬฒeฬฒvฬฒeฬฒlฬฒ are 1ฬฒ or 2ฬฒ. Level 1 specifies the
original tag file format and level 2 specifies a new exโ€
tended format containing extension fields (but in a manner
which retains backward-compatibility with original ๐˜ƒ๐—ถ(1) imโ€
plementations). The default level is 2. This option must apโ€
pear before the first file name. [Ignored in etags mode]
--๐—ต๐—ฒ๐—น๐—ฝ
Prints to standard output a detailed usage description, and
then exits.
--๐—ถ๐—ณ๐Ÿฌ[=yฬฒeฬฒsฬฒ|nฬฒoฬฒ]
Indicates a preference as to whether code within an "#if 0"
branch of a preprocessor conditional should be examined for
non-macro tags (macro tags are always included). Because the
intent of this construct is to disable code, the default
value of this option is nฬฒoฬฒ. Note that this indicates a prefโ€
erence only and does not guarantee skipping code within an
"#if 0" branch, since the fall-back algorithm used to generโ€
ate tags when preprocessor conditionals are too complex folโ€
lows all branches of a conditional. This option is disabled
by default.
--<๐‹๐€๐๐†>-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€=[ฬฒ+ฬฒ|ฬฒ-ฬฒ]ฬฒkฬฒiฬฒnฬฒdฬฒsฬฒ
Specifies a list of language-specific kinds of tags (or
kinds) to include in the output file for a particular lanโ€
guage, where <๐‹๐€๐๐†> is case-insensitive and is one of the
built-in language names (see the --๐—น๐—ถ๐˜€๐˜-๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ๐˜€ option for
a complete list). The parameter kฬฒiฬฒnฬฒdฬฒsฬฒ is a group of one-letโ€
ter flags designating kinds of tags (particular to the lanโ€
guage) to either include or exclude from the output. The
specific sets of flags recognized for each language, their
meanings and defaults may be list using the --๐—น๐—ถ๐˜€๐˜-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€ opโ€
tion. Each letter or group of letters may be preceded by eiโ€
ther '+' to add it to, or '-' to remove it from, the default
set. In the absence of any preceding '+' or '-' sign, only
those kinds explicitly listed in kฬฒiฬฒnฬฒdฬฒsฬฒ will be included in
the output (i.e. overriding the default for the specified
language).
As an example for the C language, in order to add prototypes
and external variable declarations to the default set of tag
kinds, but exclude macros, use --๐—ฐ-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€=+ฬฒpฬฒxฬฒ-ฬฒdฬฒ; to include
only tags for functions, use --๐—ฐ-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€=fฬฒ.
--๐—น๐—ฎ๐—ป๐—ด๐—ฑ๐—ฒ๐—ณ=nฬฒaฬฒmฬฒeฬฒ
Defines a new user-defined language, nฬฒaฬฒmฬฒeฬฒ, to be parsed with
regular expressions. Once defined, nฬฒaฬฒmฬฒeฬฒ may be used in other
options taking language names. The typical use of this opโ€
tion is to first define the language, then map file names to
it using -ฬฒ-ฬฒlฬฒaฬฒnฬฒgฬฒmฬฒaฬฒpฬฒ, then specify regular expressions using
-ฬฒ-ฬฒrฬฒeฬฒgฬฒeฬฒxฬฒ-ฬฒ<ฬฒLฬฒAฬฒNฬฒGฬฒ>ฬฒ to define how its tags are found.
--๐—น๐—ฎ๐—ป๐—ด๐—บ๐—ฎ๐—ฝ=mฬฒaฬฒpฬฒ[ฬฒ,ฬฒmฬฒaฬฒpฬฒ[ฬฒ.ฬฒ.ฬฒ.ฬฒ]ฬฒ]ฬฒ
Controls how file names are mapped to languages (see the
--๐—น๐—ถ๐˜€๐˜-๐—บ๐—ฎ๐—ฝ๐˜€ option). Each comma-separated mฬฒaฬฒpฬฒ consists of
the language name (either a built-in or user-defined lanโ€
guage), a colon, and a list of file extensions and/or file
name patterns. A file extension is specified by preceding
the extension with a period (e.g. ".c"). A file name pattern
is specified by enclosing the pattern in parentheses (e.g.
"([Mm]akefile)"). If appropriate support is available from
the runtime library of your C compiler, then the file name
pattern may contain the usual shell wildcards common on Unix
(be sure to quote the option parameter to protect the wildโ€
cards from being expanded by the shell before being passed
to ๐—ฐ๐˜๐—ฎ๐—ด๐˜€). You can determine if shell wildcards are availโ€
able on your platform by examining the output of the --๐˜ƒ๐—ฒ๐—ฟโ€
๐˜€๐—ถ๐—ผ๐—ป option, which will include "+wildcards" in the compiled
feature list; otherwise, the file name patterns are matched
against file names using a simple textual comparison. When
mapping a file extension, it will first be unmapped from any
other languages.
If the first character in a map is a plus sign, then the exโ€
tensions and file name patterns in that map will be appended
to the current map for that language; otherwise, the map
will replace the current map. For example, to specify that
only files with extensions of .c and .x are to be treated as
C language files, use "--๐—น๐—ฎ๐—ป๐—ด๐—บ๐—ฎ๐—ฝ=cฬฒ:ฬฒ.ฬฒcฬฒ.ฬฒxฬฒ"; to also add files
with extensions of .j as Java language files, specify
"--๐—น๐—ฎ๐—ป๐—ด๐—บ๐—ฎ๐—ฝ=cฬฒ:ฬฒ.ฬฒcฬฒ.ฬฒxฬฒ,ฬฒjฬฒaฬฒvฬฒaฬฒ:ฬฒ+ฬฒ.ฬฒjฬฒ". To map makefiles (e.g. files
named either "Makefile", "makefile", or having the extension
".mak") to a language called "make", specify
"--๐—น๐—ฎ๐—ป๐—ด๐—บ๐—ฎ๐—ฝ=mฬฒaฬฒkฬฒeฬฒ:ฬฒ(ฬฒ[ฬฒMฬฒmฬฒ]ฬฒaฬฒkฬฒeฬฒfฬฒiฬฒlฬฒeฬฒ)ฬฒ.ฬฒmฬฒaฬฒkฬฒ". To map files having no
extension, specify a period not followed by a non-period
character (e.g. ".", "..x", ".x."). To clear the mapping for
a particular language (thus inhibiting automatic generation
of tags for that language), specify an empty extension list
(e.g. "--๐—น๐—ฎ๐—ป๐—ด๐—บ๐—ฎ๐—ฝ=fฬฒoฬฒrฬฒtฬฒrฬฒaฬฒnฬฒ:ฬฒ"). To restore the default lanโ€
guage mappings for all a particular language, supply the
keyword "default" for the mapping. To specify restore the
default language mappings for all languages, specify
"--๐—น๐—ฎ๐—ป๐—ด๐—บ๐—ฎ๐—ฝ=dฬฒeฬฒfฬฒaฬฒuฬฒlฬฒtฬฒ". Note that file extensions are tested
before file name patterns when inferring the language of a
file.
--๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ-๐—ณ๐—ผ๐—ฟ๐—ฐ๐—ฒ=lฬฒaฬฒnฬฒgฬฒuฬฒaฬฒgฬฒeฬฒ
By default, ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ automatically selects the language of a
source file, ignoring those files whose language cannot be
determined (see ๐’๐Ž๐”๐‘๐‚๐„ ๐…๐ˆ๐‹๐„๐’, above). This option forces the
specified lฬฒaฬฒnฬฒgฬฒuฬฒaฬฒgฬฒeฬฒ (case-insensitive; either built-in or
user-defined) to be used for every supplied file instead of
automatically selecting the language based upon its extenโ€
sion. In addition, the special value aฬฒuฬฒtฬฒoฬฒ indicates that the
language should be automatically selected (which effectively
disables this option).
--๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ๐˜€=[ฬฒ+ฬฒ|ฬฒ-ฬฒ]ฬฒlฬฒiฬฒsฬฒtฬฒ
Specifies the languages for which tag generation is enabled,
with lฬฒiฬฒsฬฒtฬฒ containing a comma-separated list of language
names (case-insensitive; either built-in or user-defined).
If the first language of lฬฒiฬฒsฬฒtฬฒ is not preceded by either a
'+' or '-', the current list will be cleared before adding
or removing the languages in lฬฒiฬฒsฬฒtฬฒ. Until a '-' is encounโ€
tered, each language in the list will be added to the curโ€
rent list. As either the '+' or '-' is encountered in the
list, the languages following it are added or removed from
the current list, respectively. Thus, it becomes simple to
replace the current list with a new one, or to add or remove
languages from the current list. The actual list of files
for which tags will be generated depends upon the language
extension mapping in effect (see the --๐—น๐—ฎ๐—ป๐—ด๐—บ๐—ฎ๐—ฝ option). Note
that all languages, including user-defined languages are enโ€
abled unless explicitly disabled using this option. Language
names included in lฬฒiฬฒsฬฒtฬฒ may be any built-in language or one
previously defined with --๐—น๐—ฎ๐—ป๐—ด๐—ฑ๐—ฒ๐—ณ. The default is "all",
which is also accepted as a valid argument. See the
--๐—น๐—ถ๐˜€๐˜-๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ๐˜€ option for a complete list of the built-in
language names.
--๐—น๐—ถ๐—ฐ๐—ฒ๐—ป๐˜€๐—ฒ
Prints a summary of the software license to standard output,
and then exits.
--๐—น๐—ถ๐—ป๐—ฒ-๐—ฑ๐—ถ๐—ฟ๐—ฒ๐—ฐ๐˜๐—ถ๐˜ƒ๐—ฒ๐˜€[=yฬฒeฬฒsฬฒ|nฬฒoฬฒ]
Specifies whether "#line" directives should be recognized.
These are present in the output of preprocessors and contain
the line number, and possibly the file name, of the original
source file(s) from which the preprocessor output file was
generated. When enabled, this option will cause ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ to
generate tag entries marked with the file names and line
numbers of their locations original source file(s), instead
of their actual locations in the preprocessor output. The
actual file names placed into the tag file will have the
same leading path components as the preprocessor output
file, since it is assumed that the original source files are
located relative to the preprocessor output file (unless, of
course, the #line directive specifies an absolute path).
This option is off by default. ๐๐—ผ๐˜๐—ฒ: This option is generโ€
ally only useful when used together with the --๐—ฒ๐˜…๐—ฐ๐—บ๐—ฑ=nฬฒuฬฒmฬฒbฬฒeฬฒrฬฒ
(-๐—ป) option. Also, you may have to use either the --๐—น๐—ฎ๐—ป๐—ด๐—บ๐—ฎ๐—ฝ
or --๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ-๐—ณ๐—ผ๐—ฟ๐—ฐ๐—ฒ option if the extension of the preโ€
processor output file is not known to ๐—ฐ๐˜๐—ฎ๐—ด๐˜€.
--๐—น๐—ถ๐—ป๐—ธ๐˜€[=yฬฒeฬฒsฬฒ|nฬฒoฬฒ]
Indicates whether symbolic links (if supported) should be
followed. When disabled, symbolic links are ignored. This
option is on by default.
--๐—น๐—ถ๐˜€๐˜-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€[=lฬฒaฬฒnฬฒgฬฒuฬฒaฬฒgฬฒeฬฒ|aฬฒlฬฒlฬฒ]
Lists the tag kinds recognized for either the specified lanโ€
guage or all languages, and then exits. Each kind of tag
recorded in the tag file is represented by a one-letter
flag, which is also used to filter the tags placed into the
output through use of the --<๐‹๐€๐๐†>-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€ option. Note that
some languages and/or tag kinds may be implemented using
regular expressions and may not be available if regex supโ€
port is not compiled into ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ (see the --๐—ฟ๐—ฒ๐—ด๐—ฒ๐˜…-<๐‹๐€๐๐†> opโ€
tion). Each kind listed is enabled unless followed by
"[off]".
--๐—น๐—ถ๐˜€๐˜-๐—บ๐—ฎ๐—ฝ๐˜€[=lฬฒaฬฒnฬฒgฬฒuฬฒaฬฒgฬฒeฬฒ|aฬฒlฬฒlฬฒ]
Lists the file extensions and file name patterns which assoโ€
ciate a file name with a language for either the specified
language or all languages, and then exits. See the --๐—น๐—ฎ๐—ป๐—ด๐—บ๐—ฎ๐—ฝ
option, and ๐’๐Ž๐”๐‘๐‚๐„ ๐…๐ˆ๐‹๐„๐’, above.
--๐—น๐—ถ๐˜€๐˜-๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ๐˜€
Lists the names of the languages understood by ๐—ฐ๐˜๐—ฎ๐—ด๐˜€, and
then exits. These language names are case insensitive and
may be used in the --๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ-๐—ณ๐—ผ๐—ฟ๐—ฐ๐—ฒ, --๐—น๐—ฎ๐—ป๐—ด๐˜‚๐—ฎ๐—ด๐—ฒ๐˜€,
--<๐‹๐€๐๐†>-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€, and --๐—ฟ๐—ฒ๐—ด๐—ฒ๐˜…-<๐‹๐€๐๐†> options.
--๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐˜€=fฬฒiฬฒlฬฒeฬฒ
Read additional options from fฬฒiฬฒlฬฒeฬฒ. The file should contain
one option per line. As a special case, if --๐—ผ๐—ฝ๐˜๐—ถ๐—ผ๐—ป๐˜€=NฬฒOฬฒNฬฒEฬฒ is
specified as the first option on the command line, it will
disable the automatic reading of any configuration options
from either a file or the environment (see ๐…๐ˆ๐‹๐„๐’).
--๐—ฟ๐—ฒ๐—ฐ๐˜‚๐—ฟ๐˜€๐—ฒ[=yฬฒeฬฒsฬฒ|nฬฒoฬฒ]
Recurse into directories encountered in the list of supplied
files. If the list of supplied files is empty and no file
list is specified with the -๐‹ option, then the current diโ€
rectory (i.e. ".") is assumed. Symbolic links are followed.
If you don't like these behaviors, either explicitly specify
the files or pipe the output of ๐—ณ๐—ถ๐—ป๐—ฑ(1) into ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ -๐‹- inโ€
stead. ๐๐—ผ๐˜๐—ฒ: This option is not supported on all platforms
at present. It is available if the output of the --๐—ต๐—ฒ๐—น๐—ฝ opโ€
tion includes this option. See, also, the --๐—ฒ๐˜…๐—ฐ๐—น๐˜‚๐—ฑ๐—ฒ to
limit recursion.
--๐—ฟ๐—ฒ๐—ด๐—ฒ๐˜…-<๐‹๐€๐๐†>=/ฬฒrฬฒeฬฒgฬฒeฬฒxฬฒpฬฒ/ฬฒrฬฒeฬฒpฬฒlฬฒaฬฒcฬฒeฬฒmฬฒeฬฒnฬฒtฬฒ/ฬฒ[ฬฒkฬฒiฬฒnฬฒdฬฒ-ฬฒsฬฒpฬฒeฬฒcฬฒ/ฬฒ]ฬฒ[ฬฒfฬฒlฬฒaฬฒgฬฒsฬฒ]ฬฒ
The /ฬฒrฬฒeฬฒgฬฒeฬฒxฬฒpฬฒ/ฬฒrฬฒeฬฒpฬฒlฬฒaฬฒcฬฒeฬฒmฬฒeฬฒnฬฒtฬฒ/ฬฒ pair define a regular expression
replacement pattern, similar in style to ๐˜€๐—ฒ๐—ฑ substitution
commands, with which to generate tags from source files
mapped to the named language, <๐‹๐€๐๐†>, (case-insensitive; eiโ€
ther a built-in or user-defined language). The regular exโ€
pression, rฬฒeฬฒgฬฒeฬฒxฬฒpฬฒ, defines an extended regular expression
(roughly that used by ๐—ฒ๐—ด๐—ฟ๐—ฒ๐—ฝ(1)), which is used to locate a
single source line containing a tag and may specify tab
characters using \t. When a matching line is found, a tag
will be generated for the name defined by rฬฒeฬฒpฬฒlฬฒaฬฒcฬฒeฬฒmฬฒeฬฒnฬฒtฬฒ, which
generally will contain the special back-references \1
through \9 to refer to matching sub-expression groups within
rฬฒeฬฒgฬฒeฬฒxฬฒpฬฒ. The '/' separator characters shown in the parameter
to the option can actually be replaced by any character.
Note that whichever separator character is used will have to
be escaped with a backslash ('\') character wherever it is
used in the parameter as something other than a separator.
The regular expression defined by this option is added to
the current list of regular expressions for the specified
language unless the parameter is omitted, in which case the
current list is cleared.
Unless modified by fฬฒlฬฒaฬฒgฬฒsฬฒ, rฬฒeฬฒgฬฒeฬฒxฬฒpฬฒ is interpreted as a Posix
extended regular expression. The rฬฒeฬฒpฬฒlฬฒaฬฒcฬฒeฬฒmฬฒeฬฒnฬฒtฬฒ should expand
for all matching lines to a non-empty string of characters,
or a warning message will be reported. An optional kind
specifier for tags matching rฬฒeฬฒgฬฒeฬฒxฬฒpฬฒ may follow rฬฒeฬฒpฬฒlฬฒaฬฒcฬฒeฬฒmฬฒeฬฒnฬฒtฬฒ,
which will determine what kind of tag is reported in the
"kind" extension field (see ๐“๐€๐† ๐…๐ˆ๐‹๐„ ๐…๐Ž๐‘๐Œ๐€๐“, below). The
full form of kฬฒiฬฒnฬฒdฬฒ-ฬฒsฬฒpฬฒeฬฒcฬฒ is in the form of a single letter, a
comma, a name (without spaces), a comma, a description, folโ€
lowed by a separator, which specify the short and long forms
of the kind value and its textual description (displayed usโ€
ing --๐—น๐—ถ๐˜€๐˜-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€). Either the kind name and/or the descripโ€
tion may be omitted. If kฬฒiฬฒnฬฒdฬฒ-ฬฒsฬฒpฬฒeฬฒcฬฒ is omitted, it defaults to
"rฬฒ,ฬฒrฬฒeฬฒgฬฒeฬฒxฬฒ". Finally, fฬฒlฬฒaฬฒgฬฒsฬฒ are one or more single-letter
characters having the following effect upon the interpretaโ€
tion of rฬฒeฬฒgฬฒeฬฒxฬฒpฬฒ:
bฬฒ The pattern is interpreted as a Posix basic regular
expression.
eฬฒ The pattern is interpreted as a Posix extended reguโ€
lar expression (default).
iฬฒ The regular expression is to be applied in a case-inโ€
sensitive manner.
Note that this option is available only if ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ was comโ€
piled with support for regular expressions, which depends
upon your platform. You can determine if support for regular
expressions is compiled in by examining the output of the
--๐˜ƒ๐—ฒ๐—ฟ๐˜€๐—ถ๐—ผ๐—ป option, which will include "+regex" in the comโ€
piled feature list.
For more information on the regular expressions used by
๐—ฐ๐˜๐—ฎ๐—ด๐˜€, see either the ๐—ฟ๐—ฒ๐—ด๐—ฒ๐˜…(๐Ÿฑ,๐Ÿณ) man page, or the GNU info
documentation for regex (e.g. "info regex").
--๐˜€๐—ผ๐—ฟ๐˜[=yฬฒeฬฒsฬฒ|nฬฒoฬฒ|fฬฒoฬฒlฬฒdฬฒcฬฒaฬฒsฬฒeฬฒ]
Indicates whether the tag file should be sorted on the tag
name (default is yฬฒeฬฒsฬฒ). Note that the original ๐˜ƒ๐—ถ(1) required
sorted tags. The fฬฒoฬฒlฬฒdฬฒcฬฒaฬฒsฬฒeฬฒ value specifies case insensitive
(or case-folded) sorting. Fast binary searches of tag files
sorted with case-folding will require special support from
tools using tag files, such as that found in the ctags readโ€
tags library, or Vim version 6.2 or higher (using "set igโ€
norecase"). This option must appear before the first file
name. [Ignored in etags mode]
--๐˜๐—ฎ๐—ด-๐—ฟ๐—ฒ๐—น๐—ฎ๐˜๐—ถ๐˜ƒ๐—ฒ[=yฬฒeฬฒsฬฒ|nฬฒoฬฒ]
Indicates that the file paths recorded in the tag file
should be relative to the directory containing the tag file,
rather than relative to the current directory, unless the
files supplied on the command line are specified with absoโ€
lute paths. This option must appear before the first file
name. The default is yฬฒeฬฒsฬฒ when running in etags mode (see the
-๐—ฒ option), nฬฒoฬฒ otherwise.
--๐˜๐—ผ๐˜๐—ฎ๐—น๐˜€[=yฬฒeฬฒsฬฒ|nฬฒoฬฒ]
Prints statistics about the source files read and the tag
file written during the current invocation of ๐—ฐ๐˜๐—ฎ๐—ด๐˜€. This
option is off by default. This option must appear before
the first file name.
--๐˜ƒ๐—ฒ๐—ฟ๐—ฏ๐—ผ๐˜€๐—ฒ[=yฬฒeฬฒsฬฒ|nฬฒoฬฒ]
Enable verbose mode. This prints out information on option
processing and a brief message describing what action is beโ€
ing taken for each file considered by ๐—ฐ๐˜๐—ฎ๐—ด๐˜€. Normally, ๐—ฐ๐˜๐—ฎ๐—ด๐˜€
does not read command line arguments until after options are
read from the configuration files (see ๐…๐ˆ๐‹๐„๐’, below) and the
๐‚๐“๐€๐†๐’ environment variable. However, if this option is the
first argument on the command line, it will take effect beโ€
fore any options are read from these sources. The default is
nฬฒoฬฒ.
--๐˜ƒ๐—ฒ๐—ฟ๐˜€๐—ถ๐—ผ๐—ป
Prints a version identifier for ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ to standard output,
and then exits. This is guaranteed to always contain the
string "Exuberant Ctags".
๐Ž๐๐„๐‘๐€๐“๐ˆ๐Ž๐๐€๐‹ ๐ƒ๐„๐“๐€๐ˆ๐‹๐’
As ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ considers each file name in turn, it tries to determine
the language of the file by applying the following three tests in
order: if the file extension has been mapped to a language, if
the file name matches a shell pattern mapped to a language, and
finally if the file is executable and its first line specifies an
interpreter using the Unix-style "#!" specification (if supported
on the platform). If a language was identified, the file is
opened and then the appropriate language parser is called to opโ€
erate on the currently open file. The parser parses through the
file and adds an entry to the tag file for each language object
it is written to handle. See ๐“๐€๐† ๐…๐ˆ๐‹๐„ ๐…๐Ž๐‘๐Œ๐€๐“, below, for details
on these entries.
This implementation of ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ imposes no formatting requirements
on C code as do legacy implementations. Older implementations of
ctags tended to rely upon certain formatting assumptions in order
to help it resolve coding dilemmas caused by preprocessor condiโ€
tionals.
In general, ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ tries to be smart about conditional preprocesโ€
sor directives. If a preprocessor conditional is encountered
within a statement which defines a tag, ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ follows only the
first branch of that conditional (except in the special case of
"#if 0", in which case it follows only the last branch). The reaโ€
son for this is that failing to pursue only one branch can result
in ambiguous syntax, as in the following example:
#ifdef TWO_ALTERNATIVES
struct {
#else
union {
#endif
short a;
long b;
}
Both branches cannot be followed, or braces become unbalanced and
๐—ฐ๐˜๐—ฎ๐—ด๐˜€ would be unable to make sense of the syntax.
If the application of this heuristic fails to properly parse a
file, generally due to complicated and inconsistent pairing
within the conditionals, ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ will retry the file using a difโ€
ferent heuristic which does not selectively follow conditional
preprocessor branches, but instead falls back to relying upon a
closing brace ("}") in column 1 as indicating the end of a block
once any brace imbalance results from following a #if conditional
branch.
๐‚๐˜๐—ฎ๐—ด๐˜€ will also try to specially handle arguments lists enclosed
in double sets of parentheses in order to accept the following
conditional construct:
extern void foo __ARGS((int one, char two));
Any name immediately preceding the "((" will be automatically igโ€
nored and the previous name will be used.
C++ operator definitions are specially handled. In order for conโ€
sistency with all types of operators (overloaded and conversion),
the operator name in the tag file will always be preceded by the
string "operator " (i.e. even if the actual operator definition
was written as "operator<<").
After creating or appending to the tag file, it is sorted by the
tag name, removing identical tag lines.
๐“๐€๐† ๐…๐ˆ๐‹๐„ ๐…๐Ž๐‘๐Œ๐€๐“
When not running in etags mode, each entry in the tag file conโ€
sists of a separate line, each looking like this in the most genโ€
eral case:
tag_name<TAB>file_name<TAB>ex_cmd;"<TAB>extension_fields
The fields and separators of these lines are specified as folโ€
lows:
1. tag name
2. single tab character
3. name of the file in which the object associated with the
tag is located
4. single tab character
5. EX command used to locate the tag within the file; generโ€
ally a search pattern (either /pattern/ or ?pattern?) or
line number (see --๐—ฒ๐˜…๐—ฐ๐—บ๐—ฑ). Tag file format 2 (see --๐—ณ๐—ผ๐—ฟโ€
๐—บ๐—ฎ๐˜) extends this EX command under certain circumstances
to include a set of extension fields (described below)
embedded in an EX comment immediately appended to the EX
command, which leaves it backward-compatible with origiโ€
nal ๐˜ƒ๐—ถ(1) implementations.
A few special tags are written into the tag file for internal
purposes. These tags are composed in such a way that they always
sort to the top of the file. Therefore, the first two characters
of these tags are used a magic number to detect a tag file for
purposes of determining whether a valid tag file is being overโ€
written rather than a source file.
Note that the name of each source file will be recorded in the
tag file exactly as it appears on the command line. Therefore, if
the path you specified on the command line was relative to the
current directory, then it will be recorded in that same manner
in the tag file. See, however, the --๐˜๐—ฎ๐—ด-๐—ฟ๐—ฒ๐—น๐—ฎ๐˜๐—ถ๐˜ƒ๐—ฒ option for how
this behavior can be modified.
Extension fields are tab-separated key-value pairs appended to
the end of the EX command as a comment, as described above. These
key value pairs appear in the general form "kฬฒeฬฒyฬฒ:vฬฒaฬฒlฬฒuฬฒeฬฒ". Their
presence in the lines of the tag file are controlled by the
--๐—ณ๐—ถ๐—ฒ๐—น๐—ฑ๐˜€ option. The possible keys and the meaning of their valโ€
ues are as follows:
aฬฒcฬฒcฬฒeฬฒsฬฒsฬฒ Indicates the visibility of this class member, where
vฬฒaฬฒlฬฒuฬฒeฬฒ is specific to the language.
fฬฒiฬฒlฬฒeฬฒ Indicates that the tag has file-limited visibility.
This key has no corresponding value.
kฬฒiฬฒnฬฒdฬฒ Indicates the type, or kind, of tag. Its value is eiโ€
ther one of the corresponding one-letter flags deโ€
scribed under the various --<๐‹๐€๐๐†>-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€ options
above, or a full name. It is permitted (and is, in
fact, the default) for the key portion of this field
to be omitted. The optional behaviors are controlled
with the --๐—ณ๐—ถ๐—ฒ๐—น๐—ฑ๐˜€ option.
iฬฒmฬฒpฬฒlฬฒeฬฒmฬฒeฬฒnฬฒtฬฒaฬฒtฬฒiฬฒoฬฒnฬฒ
When present, this indicates a limited implementation
(abstract vs. concrete) of a routine or class, where
vฬฒaฬฒlฬฒuฬฒeฬฒ is specific to the language ("virtual" or "pure
virtual" for C++; "abstract" for Java).
iฬฒnฬฒhฬฒeฬฒrฬฒiฬฒtฬฒsฬฒ When present, vฬฒaฬฒlฬฒuฬฒeฬฒ. is a comma-separated list of
classes from which this class is derived (i.e. inherโ€
its from).
sฬฒiฬฒgฬฒnฬฒaฬฒtฬฒuฬฒrฬฒeฬฒ When present, vฬฒaฬฒlฬฒuฬฒeฬฒ is a language-dependent represenโ€
tation of the signature of a routine. A routine sigโ€
nature in its complete form specifies the return type
of a routine and its formal argument list. This exโ€
tension field is presently supported only for C-based
languages and does not include the return type.
In addition, information on the scope of the tag definition may
be available, with the key portion equal to some language-depenโ€
dent construct name and its value the name declared for that conโ€
struct in the program. This scope entry indicates the scope in
which the tag was found. For example, a tag generated for a C
structure member would have a scope looking like "struct:mySโ€
truct".
๐‡๐Ž๐– ๐“๐Ž ๐”๐’๐„ ๐–๐ˆ๐“๐‡ ๐•๐ˆ
Vi will, by default, expect a tag file by the name "tags" in the
current directory. Once the tag file is built, the following comโ€
mands exercise the tag indexing feature:
๐˜ƒ๐—ถ -๐˜ ๐˜๐—ฎ๐—ด Start vi and position the cursor at the file and line
where "tag" is defined.
:๐˜๐—ฎ ๐˜๐—ฎ๐—ด Find a tag.
๐‚๐˜๐—ฟ๐—น-] Find the tag under the cursor.
๐‚๐˜๐—ฟ๐—น-๐“ Return to previous location before jump to tag (not
widely implemented).
๐‡๐Ž๐– ๐“๐Ž ๐”๐’๐„ ๐–๐ˆ๐“๐‡ ๐†๐๐” ๐„๐Œ๐€๐‚๐’
Emacs will, by default, expect a tag file by the name "TAGS" in
the current directory. Once the tag file is built, the following
commands exercise the tag indexing feature:
๐Œ-๐˜… ๐˜ƒ๐—ถ๐˜€๐—ถ๐˜-๐˜๐—ฎ๐—ด๐˜€-๐˜๐—ฎ๐—ฏ๐—น๐—ฒ <๐‘๐„๐“> ๐…๐ˆ๐‹๐„ <๐‘๐„๐“>
Select the tag file, "FILE", to use.
๐Œ-. [๐“๐€๐†] <๐‘๐„๐“>
Find the first definition of TAG. The default tag is
the identifier under the cursor.
๐Œ-* Pop back to where you previously invoked "M-.".
๐‚-๐˜‚ ๐Œ-. Find the next definition for the last tag.
For more commands, see the Tฬฒaฬฒgฬฒsฬฒ topic in the Emacs info document.
๐‡๐Ž๐– ๐“๐Ž ๐”๐’๐„ ๐–๐ˆ๐“๐‡ ๐๐„๐ƒ๐ˆ๐“
NEdit version 5.1 and later can handle the new extended tag file
format (see --๐—ณ๐—ผ๐—ฟ๐—บ๐—ฎ๐˜). To make NEdit use the tag file, select
"File->Load Tags File". To jump to the definition for a tag,
highlight the word, then press Ctrl-D. NEdit 5.1 can can read
multiple tag files from different directories. Setting the X reโ€
source nedit.tagFile to the name of a tag file instructs NEdit to
automatically load that tag file at startup time.
๐‚๐€๐•๐„๐€๐“๐’
Because ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ is neither a preprocessor nor a compiler, use of
preprocessor macros can fool ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ into either missing tags or
improperly generating inappropriate tags. Although ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ has been
designed to handle certain common cases, this is the single bigโ€
gest cause of reported problems. In particular, the use of preโ€
processor constructs which alter the textual syntax of C can fool
๐—ฐ๐˜๐—ฎ๐—ด๐˜€. You can work around many such problems by using the -๐ˆ opโ€
tion.
Note that since ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ generates patterns for locating tags (see
the --๐—ฒ๐˜…๐—ฐ๐—บ๐—ฑ option), it is entirely possible that the wrong line
may be found by your editor if there exists another source line
which is identical to the line containing the tag. The following
example demonstrates this condition:
int variable;
/* ... */
void foo(variable)
int variable;
{
/* ... */
}
Depending upon which editor you use and where in the code you
happen to be, it is possible that the search pattern may locate
the local parameter declaration in foo() before it finds the acโ€
tual global variable definition, since the lines (and therefore
their search patterns are identical). This can be avoided by use
of the --๐—ฒ๐˜…๐—ฐ๐—บ๐—ฑ=nฬฒ option.
๐๐”๐†๐’
๐‚๐˜๐—ฎ๐—ด๐˜€ has more options than ๐—น๐˜€(1).
When parsing a C++ member function definition (e.g. "classโ€
Name::function"), ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ cannot determine whether the scope speciโ€
fier is a class name or a namespace specifier and always lists it
as a class name in the scope portion of the extension fields.
Also, if a C++ function is defined outside of the class declaraโ€
tion (the usual case), the access specification (i.e. public,
protected, or private) and implementation information (e.g. virโ€
tual, pure virtual) contained in the function declaration are not
known when the tag is generated for the function definition. It
will, however be available for prototypes (e.g --๐—ฐ++-๐—ธ๐—ถ๐—ป๐—ฑ๐˜€=+ฬฒpฬฒ).
No qualified tags are generated for language objects inherited
into a class.
๐„๐๐•๐ˆ๐‘๐Ž๐๐Œ๐„๐๐“ ๐•๐€๐‘๐ˆ๐€๐๐‹๐„๐’
๐‚๐“๐€๐†๐’ If this environment variable exists, it will be expected
to contain a set of default options which are read when
๐—ฐ๐˜๐—ฎ๐—ด๐˜€ starts, after the configuration files listed in
๐…๐ˆ๐‹๐„๐’, below, are read, but before any command line opโ€
tions are read. Options appearing on the command line
will override options specified in this variable. Only
options will be read from this variable. Note that all
white space in this variable is considered a separator,
making it impossible to pass an option parameter containโ€
ing an embedded space. If this is a problem, use a conโ€
figuration file instead.
๐„๐“๐€๐†๐’ Similar to the ๐‚๐“๐€๐†๐’ variable above, this variable, if
found, will be read when ๐—ฒ๐˜๐—ฎ๐—ด๐˜€ starts. If this variable
is not found, ๐—ฒ๐˜๐—ฎ๐—ด๐˜€ will try to use ๐‚๐“๐€๐†๐’ instead.
๐“๐Œ๐๐ƒ๐ˆ๐‘ On Unix-like hosts where mkstemp() is available, the
value of this variable specifies the directory in which
to place temporary files. This can be useful if the size
of a temporary file becomes too large to fit on the parโ€
tition holding the default temporary directory defined at
compilation time. ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ creates temporary files only if
either (1) an emacs-style tag file is being generated,
(2) the tag file is being sent to standard output, or (3)
the program was compiled to use an internal sort algoโ€
rithm to sort the tag files instead of the the sort utilโ€
ity of the operating system. If the sort utility of the
operating system is being used, it will generally observe
this variable also. Note that if ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ is setuid, the
value of TMPDIR will be ignored.
๐…๐ˆ๐‹๐„๐’
/ฬฒcฬฒtฬฒaฬฒgฬฒsฬฒ.ฬฒcฬฒnฬฒfฬฒ (ฬฒoฬฒnฬฒ MฬฒSฬฒDฬฒOฬฒSฬฒ,ฬฒ MฬฒSฬฒWฬฒiฬฒnฬฒdฬฒoฬฒwฬฒsฬฒ oฬฒnฬฒlฬฒyฬฒ)ฬฒ
/ฬฒeฬฒtฬฒcฬฒ/ฬฒcฬฒtฬฒaฬฒgฬฒsฬฒ.ฬฒcฬฒoฬฒnฬฒfฬฒ
/ฬฒuฬฒsฬฒrฬฒ/ฬฒlฬฒoฬฒcฬฒaฬฒlฬฒ/ฬฒeฬฒtฬฒcฬฒ/ฬฒcฬฒtฬฒaฬฒgฬฒsฬฒ.ฬฒcฬฒoฬฒnฬฒfฬฒ
$ฬฒHฬฒOฬฒMฬฒEฬฒ/ฬฒ.ฬฒcฬฒtฬฒaฬฒgฬฒsฬฒ
$ฬฒHฬฒOฬฒMฬฒEฬฒ/ฬฒcฬฒtฬฒaฬฒgฬฒsฬฒ.ฬฒcฬฒnฬฒfฬฒ (ฬฒoฬฒnฬฒ MฬฒSฬฒDฬฒOฬฒSฬฒ,ฬฒ MฬฒSฬฒWฬฒiฬฒnฬฒdฬฒoฬฒwฬฒsฬฒ oฬฒnฬฒlฬฒyฬฒ)ฬฒ
.ฬฒcฬฒtฬฒaฬฒgฬฒsฬฒ
cฬฒtฬฒaฬฒgฬฒsฬฒ.ฬฒcฬฒnฬฒfฬฒ (ฬฒoฬฒnฬฒ MฬฒSฬฒDฬฒOฬฒSฬฒ,ฬฒ MฬฒSฬฒWฬฒiฬฒnฬฒdฬฒoฬฒwฬฒsฬฒ oฬฒnฬฒlฬฒyฬฒ)ฬฒ
If any of these configuration files exist, each will be
expected to contain a set of default options which are
read in the order listed when ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ starts, but before the
๐‚๐“๐€๐†๐’ environment variable is read or any command line opโ€
tions are read. This makes it possible to set up site-
wide, personal or project-level defaults. It is possible
to compile ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ to read an additional configuration file
before any of those shown above, which will be indicated
if the output produced by the --๐˜ƒ๐—ฒ๐—ฟ๐˜€๐—ถ๐—ผ๐—ป option lists the
"custom-conf" feature. Options appearing in the ๐‚๐“๐€๐†๐’ enโ€
vironment variable or on the command line will override
options specified in these files. Only options will be
read from these files. Note that the option files are read
in line-oriented mode in which spaces are significant
(since shell quoting is not possible). Each line of the
file is read as one command line parameter (as if it were
quoted with single quotes). Therefore, use new lines to
indicate separate command-line arguments.
tฬฒaฬฒgฬฒsฬฒ The default tag file created by ๐—ฐ๐˜๐—ฎ๐—ด๐˜€.
TฬฒAฬฒGฬฒSฬฒ The default tag file created by ๐—ฒ๐˜๐—ฎ๐—ด๐˜€.
๐’๐„๐„ ๐€๐‹๐’๐Ž
The official Exuberant Ctags web site at:
http://ctags.sourceforge.net
Also ๐—ฒ๐˜…(1), ๐˜ƒ๐—ถ(1), ๐—ฒ๐—น๐˜ƒ๐—ถ๐˜€, or, better yet, ๐˜ƒ๐—ถ๐—บ, the official ediโ€
tor of ๐—ฐ๐˜๐—ฎ๐—ด๐˜€. For more information on ๐˜ƒ๐—ถ๐—บ, see the VIM Pages web
site at:
http://www.vim.org/
๐€๐”๐“๐‡๐Ž๐‘
Darren Hiebert <dhiebert at users.sourceforge.net>
http://DarrenHiebert.com/
๐Œ๐Ž๐“๐ˆ๐•๐€๐“๐ˆ๐Ž๐
"Think ye at all times of rendering some service to every member
of the human race."
"All effort and exertion put forth by man from the fullness of
his heart is worship, if it is prompted by the highest motives
and the will to do service to humanity."
-- From the Baha'i Writings
๐‚๐‘๐„๐ƒ๐ˆ๐“๐’
This version of ๐—ฐ๐˜๐—ฎ๐—ด๐˜€ was originally derived from and inspired by
the ctags program by Steve Kirkendall <kirkenda@cs.pdx.edu> that
comes with the Elvis vi clone (though virtually none of the origโ€
inal code remains).
Credit is also due Bram Moolenaar <Bram@vim.org>, the author of
๐˜ƒ๐—ถ๐—บ, who has devoted so much of his time and energy both to deโ€
veloping the editor as a service to others, and to helping the
orphans of Uganda.
The section entitled "HOW TO USE WITH GNU EMACS" was shamelessly
stolen from the info page for GNU ๐—ฒ๐˜๐—ฎ๐—ด๐˜€.
Darren Hiebert Version 5.9~svn20110310 CTAGS(1)