#
# Copyright (c) 2014, 2016
#	Tama Communications Corporation
#
# This file is part of GNU GLOBAL.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
@HEADER	HTAGS-SERVER,1,November 2016,GNU Project
@NAME	htags-server - a private Web/CGI server for htags
@SYNOPSIS
	@name{htags-server} [-b ip-address][-u language][--retry[=n]][@arg{port}]
@DESCRIPTION
	@name{Htags-server} is a private Web/CGI server for the hyper-text
	generated by @xref{htags,1}.

	In advance of using this command, you should execute @xref{htags,1}.
	Then you can execute htags-server at the same place.
	You can start browsing at 'http://localhost:8000/' by default.
	To stop the server, just press on 'CTRL-C'.

	Python 2/3 or Ruby equipped with WEBrick is required.
	By default, @name{htags-server} looks for python first, if not found then
	looks for ruby.
@OPTIONS
	The following options are available:
	@begin_itemize
	@item{@option{-b}, @option{--bind} @arg{ip-address}}
		Specifies the IP address on which @name{htags-server} listen.
		The default value is 127.0.0.1.
	@item{@option{-u}, @option{--use} @arg{language}}
		Specifies language to use, which may be one of: @val{python} and @val{ruby}.
	@item{@option{--retry}[=@arg{n}]}
		If the port is already in use, retry @arg{n} times with incrementing the @arg{port} number. The default of @arg{n} is 20.
	@item{@arg{port}}
		Specifies the port on which @name{htags-server} listen.
		If you want to use multiple sessions, you must use unique number
		for each @name{htags-server}. The default value is 8000.
	@end_itemize
@EXAMPLES
	@begin_verbatim
	$ gtags
	$ htags --suggest2
	$ htags-server
	Python2 http/cgi server
	Serving HTTP on 127.0.0.1 port 8000 ...

	(another terminal)
	$ firefox http://localhost:8000/

	$ htags-server
	Error: port 8000 already in use.
	$ htags-server --retry
	Warning: port 8000 already in use (skipped)
	Please access at http://127.0.0.1:8001
	Python2 http/cgi server
	Serving HTTP on 127.0.0.1 port 8001 ...
	@end_verbatim
@DIAGNOSTICS
	@name{Htags-server} exits with a non-0 value if an error occurred, 0 otherwise.
@SEE ALSO
	@xref{global,1},
	@xref{gtags,1},
	@xref{htags,1},
	@xref{python,1},
	@xref{ruby,1}.

        GNU Global source code tag system@br
        (http://www.gnu.org/software/global/).
@AUTHOR
	Shigio YAMAGUCHI.
@HISTORY
	The @name{htags-server} command appeared in Global-6.3 (2014).
