diff options
| author | Rob Pike <r@golang.org> | 2013-03-11 14:07:47 -0700 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2013-03-11 14:07:47 -0700 |
| commit | 5f91a62a3cc8da7cccb4e0c74e69321e00c8e590 (patch) | |
| tree | f33ef93a6671fc52f95022d1a069c23fe7b16e37 /src | |
| parent | 7b4ac31cab7480084f45c2890c4ebd877944bc49 (diff) | |
| download | go-5f91a62a3cc8da7cccb4e0c74e69321e00c8e590.tar.xz | |
cmd/go: fix description of -o flag to build
Fixes #5003.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7476047
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/go/doc.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cmd/go/doc.go b/src/cmd/go/doc.go index 0297b76022..bf5be6ad02 100644 --- a/src/cmd/go/doc.go +++ b/src/cmd/go/doc.go @@ -56,9 +56,13 @@ build writes the resulting executable to output. Otherwise build compiles the packages but discards the results, serving only as a check that the packages can be built. -The -o flag specifies the output file name. If not specified, the -name is packagename.a (for a non-main package) or the base -name of the first source file (for a main package). +The -o flag specifies the output file name. If not specified, the +output file name depends on the arguments and derives from the name +of the package, such as p.a for package p, unless p is 'main'. If +the package is main and file names are provided, the file name +derives from the first file name mentioned, such as f1 for 'go build +f1.go f2.go'; with no files provided ('go build'), the output file +name is the base name of the containing directory. The build flags are shared by the build, install, run, and test commands: @@ -66,6 +70,8 @@ The build flags are shared by the build, install, run, and test commands: force rebuilding of packages that are already up-to-date. -n print the commands but do not run them. + -o file + specify output file name; see description above. -p n the number of builds that can be run in parallel. The default is the number of CPUs available. |
