HTAGS(1)
π HTAGS(1) π
okay bestie, sit down, because htags is literally the moment. it's a General Commands Manual page, section 1, and it's about to make your source code look gorgeous. π¦
β¨ NAME β¨
htags β generate a hypertext from a set of source files. no cap, that's the whole job. π
πΈ SYNOPSIS πΈ
htags [-aDfFghInosTvw][-d dbpath][-m name][-t title][dir]
π DESCRIPTION π
so. htags generates a hypertext from a set of source files β and we're talking C, Yacc, Java, PHP and assembly. all of them. the whole squad. π
before you run this, you gotta run gtags(1) in the root directory of your source project first. that's the vibe check. then you run htags in the exact same place. htags makes a directory named HTML, drops the hypertext inside it, and you can start browsing at HTML/index.html. literally that easy. β¨
here's the tea: as long as you don't specify -D or -f, htags generates a static hypertext, which means you can move it anywhere and browse it with any browser β no HTTP server required, we love a low-maintenance queen. π
but if you use-Dor-f, you DO need an HTTP server. any HTTP server works, buthtags-server(1)is the recommended one. π«Ά
ngl, this command has so many options. if you're new to htags, use --suggest β with that option, htags picks popular options on your behalf. it's giving "let the algorithm choose your outfit." π
π OPTIONS π
the following options are available:
-a,--alphabetβ make an alphabetical index suitable for a large project. big-project energy only. π--auto-completion[=limit]β enable the auto-completion facility for the input form. if limit is specified, the number of candidates is limited to that value. please note this function requires javascript language in your browser. β οΈ-C,--directory dirβ change the directory before doing all the work including parameter analysis. yes, before the analysis. she's thorough. π--cautionβ display a caution message on the top page.--cflow cflowfileβ add a call tree bycflow(1).cflowfilemust be posix format. if you use GNU cflow, invoke the command at the project root directory with the--format=posixoption. this option is deprecated; please use--call-treeor--callee-treeinstead. π¨--call-tree callfileβ add a call tree bycflow(1);callfilemust be posix format. if you use GNU cflow, invoke the command at the project root directory with the--format=posixoption.--callee-tree calleefileβ add a callee tree bycflow(1);calleefilemust be posix format. if you use GNU cflow, invoke the command at the project root directory with the--format=posixand--reverseoptions.--colorize-warned-lineβ use color to highlight warned lines. aesthetic and functional. π¨--cvsweb urlβ add a link to cvsweb; url is used as the base of URL. when directoryCVSexists in the root directory of the project, the content ofCVS/Repositoryis used as the relative path from the base.--cvsweb-cvsroot cvsrootβ specify cvsroot in cvsweb URL.-D,--dynamicβ 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. π₯οΈ-d,--dbpath dbpathβ specify the directory in whichGTAGSexists. the default is the current directory.--disable-grepβ disable grep in the search form (-f,--form).--disable-idutilsβ disable idutils in the search form (-f,--form).-F,--frameβ use frames for the top page. (yes, frames. retro icon behavior. π΅)-f,--formβ add a search form using CGI program. you need to start a HTTP server for it.--fixed-guideβ put a fixed guide at the bottom of the screen of the browser.--full-pathβ use full path name in the file index. by default, use just the last component of a path.-g,--gtagsβ executegtags(1)before starting job. the-v,-wanddbpathoptions are passed togtags.--gtagsconf fileβ set environment variableGTAGSCONFto file.--gtagslabel labelβ set environment variableGTAGSLABELto label.-h,--func-header[=position]β insert a function header for each function. by default,htagsdoesn't generate them. you can choose the position using position, which allows one ofbefore,rightorafter(default).--helpβ print a usage message.--html-header fileβ insert a header record derived from file into the HTML header of each file.-I,--iconβ use icons instead of text for some links. π--insert-footer fileβ insert custom footer derived from file before</body>tag.--insert-header fileβ insert custom header derived from file after<body>tag.--item-order specβ 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 iscsmdf.-m,--main-func nameβ specify startup function name; the default ismain.--map-fileβ generate fileMAP.-n,--line-number[=columns]β print line numbers. by default, don't print line numbers. the default value of columns is4.--no-order-listβ numbers are not given in list form.-o,--otherβ pick up not only source files but also other files for the file index.-s,--symbolβ make anchors not only for definitions and references but also other symbols.--show-positionβ print the position string per function definition. the string can be interpreted by general editors in UNIX. the default isfalse.--statisticsβ print statistics information.--suggestβhtagschooses popular options on behalf of beginners. it is equivalent to-aghInosTxv --show-position --fixed-guidenow.--suggest2βhtagschooses popular options on behalf of beginners. this option enables frame, AJAX and CGI facility in addition to the facilities by the--suggestoption. it is equivalent to--suggest -DfF --auto-completion --tree-view=filetreenow. π₯-T,--table-flist[=rows]β use<table>tag to display the file index. you can optionally specify the number of rows; the default is5.-t,--title titleβ title of the hypertext. the default is the last component of the path of the current directory.--tabs colsβ tab stops. the default is8.--table-listβ use<table>tag to display the tag list.--tree-view[=type]β 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 istreeview. π³-v,--verboseβ verbose mode.--versionβ show version number.-w,--warningβ print warning messages.dirβ the directory in which the result of this command is stored. the default is the current directory.
β EXAMPLES β
like, actual receipts:
$ 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
π§ FILES π§
the whole cast of characters:
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. seegtags.conf(5).HTML/FILEMAPβ mapping file for converting file name into the path of the file.HTML/GTAGSROOTβ if this file exists, CGI programglobal.cgisets environment variableGTAGSROOTto the contents of it. if you move directoryHTMLfrom the original place, please make this file. πHTML/.htaccessβ local configuration file for Apache. this file is generated when the-for-Doptions 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).
π¦ ENVIRONMENT π¦
the following environment variables affect the execution of htags:
GTAGSCACHEβ the size of the B-tree cache. the default is50000000(bytes).GTAGSCONFβ configuration file.GTAGSLABELβ configuration label. the default isdefault.HTAGS_OPTIONSβ the value of this variable is inserted in the head of arguments. β¨TMPDIRβ the location used to stored temporary files. the default is/tmp.GTAGSFORCECPPβ if this variable is set, each file whose suffix is.his treated as a C++ source file. plot twist! π³
π CONFIGURATION π
the following configuration variables affect the execution of htags:
datadir(string) β shared data directory. the default is/usr/local/sharebut you can change the value using configure script.htagslooks up template files in thegtagsdirectory in this data directory.include_file_suffixes(comma separated list) β suffixes of include files. the default is:h,hh,hxx,hpp,H,inc.php.langmap(comma separated list) β 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.
π DIAGNOSTICS π
htags exits with a non-0 value if an error occurred, 0 otherwise. simple as that. βοΈ
π₯ SEE ALSO π₯
htags-server(1), global(1), gtags(1), gtags.conf(5).
GNU Global source code tag system (http://www.gnu.org/software/global/).
π BUG π
okay this is the serious part, bestie, listen up:
- generated hypertext is VERY LARGE. in advance, check the space of your disk. like, fr fr, check it. πΎ
- PHP support is far from complete. π
- the
-fand-Doptions generate CGI programs. if you open the hypertext to the public, please recognize security dangers. π¨ htagsdoes not support plug-in parser.
π AUTHOR π
Shigio YAMAGUCHI, Hideki IWAMOTO and others. icons, all of them. π
π HISTORY π
the htags command appeared in FreeBSD 2.2.2. a true legend since day one. π
and that's the whole page, bestie π«Ά β this one came out of the GNU Project, dated June 2013, filed under HTAGS(1). go forth and generate that hypertext, you absolute main character. π
β¨π
π¦ where this page comes from
- arch rolling: global 6.7-1 Β· BSD-3-Clause AND GPL-2.0-only AND GPL-3.0-or-later AND LGPL-2.0-or-later AND LicenseRef-CALDERA AND LicenseRef-PD AND MIT
- debian bookworm: global 6.6.9-1
- debian trixie: global 6.6.13-1
- epel 10: global 6.6.15-1.el10_3 Β· GPL-3.0-or-later and LGPL-2.0-or-later and LGPL-2.1-or-later and BSD-3-Clause and MIT and LicenseRef-Fedora-Public-Domain and blessing and GFDL-1.2-or-later
- fedora 43: global 6.6.15-1.fc43 Β· GPL-3.0-or-later and LGPL-2.0-or-later and LGPL-2.1-or-later and BSD-3-Clause and MIT and LicenseRef-Fedora-Public-Domain and blessing and GFDL-1.2-or-later
- fedora 44: global 6.6.14-1.fc44 Β· GPL-3.0-or-later and LGPL-2.0-or-later and LGPL-2.1-or-later and BSD-3-Clause and MIT and LicenseRef-Fedora-Public-Domain and blessing and GFDL-1.2-or-later
- fedora 44: global 6.6.15-1.fc44
- fedora 44: global 6.7-1.fc44 Β· GPL-3.0-or-later and LGPL-2.0-or-later and LGPL-2.1-or-later and BSD-3-Clause and MIT and LicenseRef-Fedora-Public-Domain and blessing and GFDL-1.2-or-later
- nixos 26.05: global 6.6.14
- nixpkgs unstable: global 6.6.14
- opensuse-leap 16.0: global 6.6.13-bp160.1.13 Β· GPL-3.0-only
- opensuse-leap 16.0: global 6.6.13-bp160.1.13 Β· GPL-3.0-only
- opensuse-leap 16.0: global 6.6.13-bp160.1.13 Β· GPL-3.0-only
- opensuse-leap 16.0: global 6.6.13-bp160.1.13 Β· GPL-3.0-only
- ubuntu jammy: global 6.6.7-1
- ubuntu noble: global 6.6.11-1
- ubuntu questing: global 6.6.14-1.1
- ubuntu resolute: global 6.6.14-1.1build1
- ubuntu stonking: global 6.6.14-1.1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms