HTAGS(1)

πŸ“¦
version 6.7 Β· 2 versions
  • 6.7 Β· arch rolling, debian bookworm, debian trixie, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 6.6.5 Β· fedora 43
, in arch rolling, debian bookworm, debian trixie, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 -D or -f, you DO need an HTTP server. any HTTP server works, but htags-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 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. 🚨
  • --call-tree callfile β€” 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.
  • --callee-tree calleefile β€” 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.
  • --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 directory CVS exists in the root directory of the project, the content of CVS/Repository is 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 which GTAGS exists. 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 β€” execute gtags(1) before starting job. the -v, -w and dbpath options are passed to gtags.
  • --gtagsconf file β€” set environment variable GTAGSCONF to file.
  • --gtagslabel label β€” set environment variable GTAGSLABEL to label.
  • -h, --func-header[=position] β€” 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).
  • --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 is csmdf.
  • -m, --main-func name β€” specify startup function name; the default is main.
  • --map-file β€” generate file MAP.
  • -n, --line-number[=columns] β€” print line numbers. by default, don't print line numbers. the default value of columns is 4.
  • --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 is false.
  • --statistics β€” print statistics information.
  • --suggest β€” htags chooses popular options on behalf of beginners. it is equivalent to -aghInosTxv --show-position --fixed-guide now.
  • --suggest2 β€” 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. πŸ”₯
  • -T, --table-flist[=rows] β€” use <table> tag to display the file index. you can optionally specify the number of rows; the default is 5.
  • -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 is 8.
  • --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 is treeview. 🌳
  • -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. 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).

πŸ¦‹ ENVIRONMENT πŸ¦‹

the following environment variables affect the execution of htags:

  • GTAGSCACHE β€” the size of the B-tree cache. the default is 50000000 (bytes).
  • GTAGSCONF β€” configuration file.
  • GTAGSLABEL β€” configuration label. the default is default.
  • 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 .h is 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/share but you can change the value using configure script. htags looks up template files in the gtags directory 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 -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.

πŸ‘‘ 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