Section: User Manuals (1)
Updated: August 2010
otags - generate tags files for emacs and vi/vim from OCaml sources
[STATIC-OPTION] ... [FILE] ... [DYNAMIC-OPTION] ... [FILE] ...
to give these editors the ability to directly jump to function
and value definitions (use
in Emacs and
in vi[m] with the cursor on the symbol).
uses the standard
parser from the
library. This is more precise than regular expression based
tagging. On the downside,
can only tag syntactically correct files. Furthermore,
version specific: Sources to be compiled with
can, in general, only be tagged with
This version of
does not support
preprocessors and can therefore not tag files using syntax
extensions or containing top level directives. For tagging all
files in a directory tree, see option
tags all toplevel items in structures and signatures, including
infix operators and nested modules and signatures. It also tags
instance variables and methods in classes.
on the command line are parsed as interfaces if they have a
suffix and as implementations if they have a
suffix. (See also the dynamic options
Tag files can contain absolute and/or relative file names.
uses the file names from the command line for the tags file.
Specifying relative file names on the command line will therefore
give you a tag file with relative file names. Obviously, a tag
file with relative file names will only work if it is located in
the directory where
supports writing a tags file with relative file names in a parent
directory via option
Static options take effect on the whole program run, regardless
of their position in the command line.
Descend into directories. With this option, if one of the
arguments is a directory
will recursively tag all files in this whole directory tree.
- -o file
Write tags to
The default is
option is given) in the current directory. If
is a dash (
) the tags are written to standard output.
Append to an existing TAGS file (does only work for emacs TAGS files).
Generate tags for
and change the default output file into
- -add-path path
at the front of every relative file name in the tags file.
Useful when you want to put the tags file in a parent directory.
Print version and exit.
Verbose. Print file names as they are parsed and the command
lines for externally started
parsing processes (if any). If
is the first command line argument, backtraces for exceptions are
enabled and printed if an exception escapes and terminates
(which is considered a bug, about which I would appreciate a
Print the option list.
Dynamic options do only affect arguments that follow them on the
- -intf FILE
Parse and tag
as an interface.
- -impl FILE
Parse and tag
files in the current directory tree:
Files with syntax errors will be ignored. The error messages can
be disabled with option
Parse errors are reported with normal
error messages. No tags are generated for files that produce
errors. Tagging continues with the next file, in this case.
Warnings are always completely disabled.
The errors "Original source not available" and "The parser
delivered an invalid location"
might be reported if the file contains a line directive that refers to
a position and/or a file that cannot be resolved.
For files containing a toplevel directive,
simply reports a syntax error (as
Escaping exceptions and assertions that terminate
are considered to be bugs. If they occur, please use option
command line switch to obtain an exception backtrace and submit this
with all relevant information as bug report.
everything went OK
a parse error or some other error occurred and
skipped the affected file
a fatal error caused
some bug caused a crash, from which
could only marginally recover
Appending to vi tags files requires to reread the existing tags
file, because vi tags files are sorted.
preprocessors are currently not supported.
tagger has been written by Cuihtlauac Alvarado and Jean-Francois
Monin. Around 2005 I took over and released a few versions for
versions released up to 3.09.3.3 were written for the original
which is now available as
For 3.11 I rewrote
from scratch for the new
several versions under the name
The modular structure of
made it possible to switch the parsing engine at runtime between
files and to parse all syntax supported by
at full native speed without external
processes. However, the increasing incompatibility between
sloppiness on parsing locations created more and more
difficulties. For instance,
4.02 failed on the
standard library because
was unable to digest the attribute annotations in there.
Starting from 4.03,
is based on the standard
parser from the
library and has been renamed to
Hendrik Tews <otags at askra.de>
- STATIC OPTIONS
- DYNAMIC OPTIONS
- EXIT STATUS
- MISSING FEATURES
- SEE ALSO
This document was created by
using the manual pages.
Time: 18:17:00 GMT, August 26, 2017