1
0
mirror of https://github.com/golang/go synced 2024-11-25 05:07:56 -07:00

godoc: updated documentation

R=r
CC=golang-dev
https://golang.org/cl/207112
This commit is contained in:
Robert Griesemer 2010-02-16 15:36:55 -08:00
parent 7db472fd34
commit db9a9662a1
2 changed files with 24 additions and 8 deletions

View File

@ -25,12 +25,14 @@ The flags are:
verbose mode verbose mode
-tabwidth=4 -tabwidth=4
width of tabs in units of spaces width of tabs in units of spaces
-cmdroot="src/cmd" -path=""
root command source directory (if unrooted, relative to -goroot) additional package directories (colon-separated)
-tmplroot="lib/godoc" -cmdroot="/goroot/src/cmd"
root template directory (if unrooted, relative to -goroot) command source directory under -goroot (if unrooted, relative to cwd)
-pkgroot="src/pkg" -tmplroot="/goroot/lib/godoc"
root package source directory (if unrooted, relative to -goroot) template directory under -goroot (if unrooted, relative to cwd)
-pkgroot="/goroot/src/pkg"
package source directory under -goroot (if unrooted, relative to cwd)
-html -html
print HTML in command-line mode print HTML in command-line mode
-goroot=$GOROOT -goroot=$GOROOT
@ -44,8 +46,22 @@ The flags are:
-sync_minutes=0 -sync_minutes=0
sync interval in minutes; sync is disabled if <= 0 sync interval in minutes; sync is disabled if <= 0
The -path flag accepts a list of colon-separated paths; unrooted paths are relative
to the current working directory. Each path is considered as an additional root for
packages in order of appearance. The last (absolute) path element is the prefix for
the package path. For instance, given the flag value:
path=".:/home/bar:/public"
for a godoc started in /home/user/godoc, absolute paths are mapped to package paths
as follows:
/home/user/godoc/x -> godoc/x
/home/bar/x -> bar/x
/public/x -> public/x
When godoc runs as a web server, it creates a search index from all .go files When godoc runs as a web server, it creates a search index from all .go files
under $GOROOT (excluding files starting with .). The index is created at startup under -goroot (excluding files starting with .). The index is created at startup
and is automatically updated every time the -sync command terminates with exit and is automatically updated every time the -sync command terminates with exit
status 0, indicating that files have changed. status 0, indicating that files have changed.

View File

@ -84,7 +84,7 @@ var (
tmplroot string tmplroot string
// additional file system roots to consider // additional file system roots to consider
path = flag.String("path", "", "additional pkg directories") path = flag.String("path", "", "additional package directories (colon-separated)")
// layout control // layout control
tabwidth = flag.Int("tabwidth", 4, "tab width") tabwidth = flag.Int("tabwidth", 4, "tab width")