Commit fba47dc3 authored by Dave Cheney's avatar Dave Cheney Committed by Robert Griesemer

cmd/godoc: delete -path flag

Fixes #3453.

R=golang-dev, gri, jeff, bradfitz
CC=golang-dev
https://golang.org/cl/6350086
parent 9b141270
...@@ -67,8 +67,6 @@ The flags are: ...@@ -67,8 +67,6 @@ The flags are:
-maxresults=10000 -maxresults=10000
maximum number of full text search results shown maximum number of full text search results shown
(no full text index is built if maxresults <= 0) (no full text index is built if maxresults <= 0)
-path=""
additional package directories (colon-separated)
-html -html
print HTML in command-line mode print HTML in command-line mode
-goroot=$GOROOT -goroot=$GOROOT
...@@ -88,20 +86,8 @@ The flags are: ...@@ -88,20 +86,8 @@ The flags are:
zip file providing the file system to serve; disabled if empty zip file providing the file system to serve; disabled if empty
By default, godoc looks at the packages it finds via $GOROOT and $GOPATH (if set). By default, godoc looks at the packages it finds via $GOROOT and $GOPATH (if set).
Additional directories may be specified via the -path flag which accepts a list This behavior can be altered by providing an alternative $GOROOT with the -goroot
of colon-separated paths; unrooted paths are relative to the current working flag.
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 and -index is set, a search index is maintained. When godoc runs as a web server and -index is set, a search index is maintained.
The index is created at startup. The index is created at startup.
......
...@@ -57,7 +57,6 @@ var ( ...@@ -57,7 +57,6 @@ var (
// TODO(gri) consider the invariant that goroot always end in '/' // TODO(gri) consider the invariant that goroot always end in '/'
goroot = flag.String("goroot", runtime.GOROOT(), "Go root directory") goroot = flag.String("goroot", runtime.GOROOT(), "Go root directory")
testDir = flag.String("testdir", "", "Go root subdirectory - for testing only (faster startups)") testDir = flag.String("testdir", "", "Go root subdirectory - for testing only (faster startups)")
pkgPath = 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")
...@@ -83,16 +82,6 @@ var ( ...@@ -83,16 +82,6 @@ var (
) )
func initHandlers() { func initHandlers() {
// Add named directories in -path argument as
// subdirectories of src/pkg.
for _, p := range filepath.SplitList(*pkgPath) {
_, elem := filepath.Split(p)
if elem == "" {
log.Fatalf("invalid -path argument: %q has no final element", p)
}
fs.Bind("/src/pkg/"+elem, OS(p), "/", bindReplace)
}
fileServer = http.FileServer(&httpFS{fs}) fileServer = http.FileServer(&httpFS{fs})
cmdHandler = docServer{"/cmd/", "/src/cmd", false} cmdHandler = docServer{"/cmd/", "/src/cmd", false}
pkgHandler = docServer{"/pkg/", "/src/pkg", true} pkgHandler = docServer{"/pkg/", "/src/pkg", true}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment