[Previous] [Contents] [Index] [Next]

ctags

Generate tags files (POSIX)

Syntax:

ctags options files...

Options:

-a
Append to the tags file, instead of overwriting it.
-B
Use ?regexp? instead of /regexp/.
-Dword
Ignore word. This is handy for parameter macro names.
-e
Include extern tags.
-F
Use /regexp/ (the default).
-h
Add hints to help elvis distinguish between overloaded tags.
-i
Include inline definitions.
-l
("el") Add a ln line number hint (implies -h).
-N
Use line numbers instead of /regexp/.
-p
Write parsing information to stdout (for debugging ctags).
-r
Write a refs file, in addition to tags.
-s
Include static tags.
-t
Include typedefs.
-v
Include variable declarations.
-x
Write a cross-reference table to stdout instead of to the tags file.
files
The pathnames of the files that are to be scanned for tags.

Description:

The ctags utility generates a file called tags from a group of C source files.

Each C source file is scanned for #define statements and function definitions. The name of the macro or function becomes the name of a tag. For each tag, a line is added to the tags file, which contains:

If you don't specify any options, ctags uses -l -i -s -t -v.

The elvis, less, more, and vi utilities can use entries in the tags file to locate and display a definition.

Examples:

Generate tags for all the C source and header files in the current directory:

ctags *.[ch]

Author:

Steve Kirkendall; ctags is part of the elvis suite. Report bugs to kirkenda@cs.pdx.edu.

See also:

elvis, less, more, vi


[Previous] [Contents] [Index] [Next]