
106
|
Chapter 3: Linux Commands
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
ctags
ctags [options] files
Create a list of function and macro names defined in a program-
ming source file. More than one file may be specified. ctags
understands many programming languages, including C, C++,
FORTRAN, Java, Perl, Python, flex, yacc, and bison. The output
list (named tags by default) contains lines of the form:
name file context
where name is the function or macro name, file is the source file in
which name is defined, and context is a search pattern that shows
the line of code containing name. After the list of tags is created,
you can invoke vi on any file and type:
:set tags=tagsfile
:tag name
This switches the vi editor to the source file associated with the
name listed in tagsfile (which you specify with -t).
etags produces an equivalent file for tags to be used with Emacs.
Options
-a Append tag output to existing list of tags.
-e Create tag files for use with emacs.
-h extensionlist
Interpret files with filename extensions specified in extension-
list as header files. The default list is “.h.H.hh.hpp.hxx.h++.
inc.def”. To indicate that files without extensions should be
treated as header files, insert an additional period in the list
before another period or at the end of the list, or use just a
period by itself. To use this option multiple ...