HTAGS(1) General Commands Manual HTAGS(1)

htags - generate a hypertext from a set of source files

htags [-aDfFghInosTvw][-d dbpath][-m name][-t title][dir]

Htags generates a hypertext from a set of source files of C, Yacc, Java, PHP and assembly.

In advance of using this command, you should execute gtags(1) in the root directory of a source project. Then you can execute htags in the same place. Htags makes a directory named ´HTML´, and puts a hypertext in it. You can start browsing at ´HTML/index.html´.

Since htags generates a static hypertext as long as neither -D nor -f option is not specified, you can move it anywhere and browse it by any browser without any HTTP server. If you use -D or -f option, you need to use HTTP server. Though any HTTP server is available, htags-server(1) is recommended.

This command has so many options. If you are new to htags, it is recommended to use --suggest option. With that option, htags chooses popular options on your behalf.

The following options are available:

Make an alphabetical index suitable for a large project.
Enable auto-completion facility for the input form. If limit is specified, number of candidates is limited to the value. Please note this function requires javascript language in your browser.
Change the directory before doing all the work including parameter analysis.
Display a caution message on the top page.
Add a call tree by cflow(1). cflowfile must be posix format. If you use GNU cflow, invoke the command at the project root directory with the --format=posix option. This option is deprecated; please use --call-tree or --callee-tree instead.
Add a call tree by cflow(1); callfile must be posix format. If you use GNU cflow, invoke the command at the project root directory with the --format=posix option.
Add a callee tree by cflow(1); calleefile must be posix format. If you use GNU cflow, invoke the command at the project root directory with the --format=posix and --reverse options.
Use color to highlight warned lines.
Add a link to cvsweb; url is used as the base of URL. When directory ´CVS´ exists in the root directory of the project, the content of ´CVS/Repository´ is used as the relative path from the base.
Specify cvsroot in cvsweb URL.
Generate a tag list dynamically using CGI program. Though this option decreases both the size and generation time of hypertext, you need to start up HTTP server.
Specify the directory in which ´GTAGS´ exists. The default is the current directory.
Disable grep in the search form (-f, --form).
Disable idutils in the search form (-f, --form).
Use frames for the top page.
Add a search form using CGI program. You need to start a HTTP server for it.
Put a fixed guide at the bottom of the screen of the browser.
Use full path name in the file index. By default, use just the last component of a path.
Execute gtags(1) before starting job. The -v, -w and dbpath options are passed to gtags.
Set environment variable GTAGSCONF to file.
Set environment variable GTAGSLABEL to label.
Insert a function header for each function. By default, htags doesn't generate them. You can choose the position using position, which allows one of ´before´, ´right´ or ´after´ (default).
Print a usage message.
Insert a header record derived from file into the HTML header of each file.
Use icons instead of text for some links.
Insert custom footer derived from file before </body> tag.
Insert custom header derived from file after <body> tag.
Specify the order of the items in the top page. The spec is a string consisting of item signs in order. Each sign means as follows: ´c´: caution; ´s´: search form; ´m´: mains; ´d´: definitions; ´f´: files; ´t´: call tree. The default is ´csmdf´.
Specify startup function name; the default is ´main´.
Generate file ´MAP´.
Print line numbers. By default, don't print line numbers. The default value of columns is 4.
Numbers are not given in list form.
Pick up not only source files but also other files for the file index.
Make anchors not only for definitions and references but also other symbols.
Print the position string per function definition. The string can be interpreted by general editors in UNIX. The default is false.
Print statistics information.
Htags chooses popular options on behalf of beginners. It is equivalent to -aghInosTxv --show-position --fixed-guide now.
Htags chooses popular options on behalf of beginners. This option enables frame, AJAX and CGI facility in addition to the facilities by the --suggest option. It is equivalent to --suggest -DfF --auto-completion --tree-view=filetree now.
Use <table> tag to display the file index. You can optionally specify the number of rows; the default is 5.
Title of the hypertext. The default is the last component of the path of the current directory.
Tab stops. The default is 8.
Use <table> tag to display the tag list.
Use treeview for the file index. Please note this function requires javascript language in your browser. Possible values of type are as follows: treeview, filetree, treeview-red, treeview-black, treeview-gray, treeview-famfamfam. The default is treeview.
Verbose mode.
Show version number.
Print warning messages.
The directory in which the result of this command is stored. The default is the current directory.

$ gtags -v
$ htags -sanohITvt 'Welcome to XXX source tour!'
$ firefox HTML/index.html
$ htags --suggest2
$ htags-server >& log &
$ firefox http://127.0.0.1:8000

´GTAGS´
Tag file for definitions.
´GRTAGS´
Tag file for references.
´GPATH´
Tag file for source files.
´gtags.conf´, ´$HOME/.globalrc´
Configuration data for GNU Global. See gtags.conf(5).
´HTML/FILEMAP´
Mapping file for converting file name into the path of the file.
´HTML/GTAGSROOT´
If this file exists, CGI program ´global.cgi´ sets environment variable GTAGSROOT to the contents of it. If you move directory ´HTML´ from the original place, please make this file.
´HTML/.htaccess´
Local configuration file for Apache. This file is generated when the -f or -D options are specified.
´HTML/index.html´
Start-up file.
´HTML/MAP´
Mapping file for converting tag name into the path of tag list.
´HTML/style.css´
Style sheet file.
´/usr/local/share/gtags/style.css.tmpl´
The template of the style sheet file (´HTML/style.css´).

The following environment variables affect the execution of htags:

The size of the B-tree cache. The default is 50000000 (bytes).
Configuration file.
Configuration label. The default is ´default´.
The value of this variable is inserted in the head of arguments.
The location used to stored temporary files. The default is ´/tmp´.
If this variable is set, each file whose suffix is ´.h´ is treated as a C++ source file.

The following configuration variables affect the execution of htags:

Shared data directory. The default is ´/usr/local/share´ but you can change the value using configure script. Htags looks up template files in the ´gtags´ directory in this data directory.
Suffixes of include files. The default is:
´h,hh,hxx,hpp,H,inc.php´.
Language mapping. Each comma-separated map consists of the language name, a colon, and a list of file extensions. Default mapping is:
´c:.c.h,yacc:.y,asm:.s.S,java:.java,cpp:.c++.cc.hh.cpp.cxx.hxx.hpp.C.H,php:.php.php3.phtml´.

Htags exits with a non-0 value if an error occurred, 0 otherwise.

htags-server(1), global(1), gtags(1), gtags.conf(5).

GNU Global source code tag system
(http://www.gnu.org/software/global/).

Generated hypertext is VERY LARGE. In advance, check the space of your disk.

PHP support is far from complete.

The -f and -D options generate CGI programs. If you open the hypertext to the public, please recognize security dangers.

Htags does not support plug-in parser.

Shigio YAMAGUCHI, Hideki IWAMOTO and others.

The htags command appeared in FreeBSD 2.2.2.

June 2013 GNU Project