Commit a7e81c37 authored by Jeff R. Allen's avatar Jeff R. Allen Committed by Rob Pike

cmd/go: avoid long lines in help messages

Reformat some help messages to stay within 80 characters.

Fixes #11840.

Change-Id: Iebafcb616f202ac44405e5897097492a79a51722
Reviewed-on: https://go-review.googlesource.com/12514Reviewed-by: default avatarRob Pike <r@golang.org>
parent 6aa48a9a
......@@ -204,8 +204,8 @@ Usage:
Doc prints the documentation comments associated with the item identified by its
arguments (a package, const, func, type, var, or method) followed by a one-line
summary of each of the first-level items "under" that item (package-level declarations
for a package, methods for a type, etc.).
summary of each of the first-level items "under" that item (package-level
declarations for a package, methods for a type, etc.).
Doc accepts zero, one, or two arguments.
......@@ -213,30 +213,31 @@ Given no arguments, that is, when run as
go doc
it prints the package documentation for the package in the current directory. If
the package is a command (package main), the exported symbols of the package are
elided from the presentation unless the -cmd flag is provided.
it prints the package documentation for the package in the current directory.
If the package is a command (package main), the exported symbols of the package
are elided from the presentation unless the -cmd flag is provided.
When run with one argument, the argument is treated as a Go-syntax-like representation
of the item to be documented. What the argument selects depends on what is installed
in GOROOT and GOPATH, as well as the form of the argument, which is schematically
one of these:
When run with one argument, the argument is treated as a Go-syntax-like
representation of the item to be documented. What the argument selects depends
on what is installed in GOROOT and GOPATH, as well as the form of the argument,
which is schematically one of these:
go doc <pkg>
go doc <sym>[.<method>]
go doc [<pkg>].<sym>[.<method>]
The first item in this list matched by the argument is the one whose documentation
is printed. (See the examples below.) For packages, the order of scanning is
determined lexically, but the GOROOT tree is always scanned before GOPATH.
The first item in this list matched by the argument is the one whose
documentation is printed. (See the examples below.) For packages, the order of
scanning is determined lexically, but the GOROOT tree is always scanned before
GOPATH.
If there is no package specified or matched, the package in the current directory
is selected, so "go doc Foo" shows the documentation for symbol Foo in the current
package.
If there is no package specified or matched, the package in the current
directory is selected, so "go doc Foo" shows the documentation for symbol Foo in
the current package.
The package path must be either a qualified path or a proper suffix of a path. The
go tool's usual package mechanism does not apply: package path elements like . and
... are not implemented by go doc.
The package path must be either a qualified path or a proper suffix of a
path. The go tool's usual package mechanism does not apply: package path
elements like . and ... are not implemented by go doc.
When run with two arguments, the first must be a full package path (not just a
suffix), and the second is a symbol or symbol and method; this is similar to the
......@@ -254,7 +255,8 @@ Examples:
Show documentation for current package.
go doc Foo
Show documentation for Foo in the current package.
(Foo starts with a capital letter so it cannot match a package path.)
(Foo starts with a capital letter so it cannot match
a package path.)
go doc encoding/json
Show documentation for the encoding/json package.
go doc json
......@@ -621,7 +623,8 @@ Run compiles and runs the main package comprising the named Go source files.
A Go source file is defined to be a file ending in a literal ".go" suffix.
By default, 'go run' runs the compiled binary directly: 'a.out arguments...'.
If the -exec flag is given, 'go run' invokes the binary using xprog: 'xprog a.out arguments...'.
If the -exec flag is given, 'go run' invokes the binary using xprog:
'xprog a.out arguments...'.
If the -exec flag is not given, GOOS or GOARCH is different from the system
default, and a program named go_$GOOS_$GOARCH_exec can be found
on the current search path, 'go run' invokes the binary using that program,
......
......@@ -10,11 +10,10 @@ var cmdDoc = &Command{
CustomFlags: true,
Short: "show documentation for package or symbol",
Long: `
Doc prints the documentation comments associated with the item identified by its
arguments (a package, const, func, type, var, or method) followed by a one-line
summary of each of the first-level items "under" that item (package-level declarations
for a package, methods for a type, etc.).
summary of each of the first-level items "under" that item (package-level
declarations for a package, methods for a type, etc.).
Doc accepts zero, one, or two arguments.
......@@ -22,30 +21,31 @@ Given no arguments, that is, when run as
go doc
it prints the package documentation for the package in the current directory. If
the package is a command (package main), the exported symbols of the package are
elided from the presentation unless the -cmd flag is provided.
it prints the package documentation for the package in the current directory.
If the package is a command (package main), the exported symbols of the package
are elided from the presentation unless the -cmd flag is provided.
When run with one argument, the argument is treated as a Go-syntax-like representation
of the item to be documented. What the argument selects depends on what is installed
in GOROOT and GOPATH, as well as the form of the argument, which is schematically
one of these:
When run with one argument, the argument is treated as a Go-syntax-like
representation of the item to be documented. What the argument selects depends
on what is installed in GOROOT and GOPATH, as well as the form of the argument,
which is schematically one of these:
go doc <pkg>
go doc <sym>[.<method>]
go doc [<pkg>].<sym>[.<method>]
The first item in this list matched by the argument is the one whose documentation
is printed. (See the examples below.) For packages, the order of scanning is
determined lexically, but the GOROOT tree is always scanned before GOPATH.
The first item in this list matched by the argument is the one whose
documentation is printed. (See the examples below.) For packages, the order of
scanning is determined lexically, but the GOROOT tree is always scanned before
GOPATH.
If there is no package specified or matched, the package in the current directory
is selected, so "go doc Foo" shows the documentation for symbol Foo in the current
package.
If there is no package specified or matched, the package in the current
directory is selected, so "go doc Foo" shows the documentation for symbol Foo in
the current package.
The package path must be either a qualified path or a proper suffix of a path. The
go tool's usual package mechanism does not apply: package path elements like . and
... are not implemented by go doc.
The package path must be either a qualified path or a proper suffix of a
path. The go tool's usual package mechanism does not apply: package path
elements like . and ... are not implemented by go doc.
When run with two arguments, the first must be a full package path (not just a
suffix), and the second is a symbol or symbol and method; this is similar to the
......@@ -63,7 +63,8 @@ Examples:
Show documentation for current package.
go doc Foo
Show documentation for Foo in the current package.
(Foo starts with a capital letter so it cannot match a package path.)
(Foo starts with a capital letter so it cannot match
a package path.)
go doc encoding/json
Show documentation for the encoding/json package.
go doc json
......
......@@ -37,7 +37,8 @@ Run compiles and runs the main package comprising the named Go source files.
A Go source file is defined to be a file ending in a literal ".go" suffix.
By default, 'go run' runs the compiled binary directly: 'a.out arguments...'.
If the -exec flag is given, 'go run' invokes the binary using xprog: 'xprog a.out arguments...'.
If the -exec flag is given, 'go run' invokes the binary using xprog:
'xprog a.out arguments...'.
If the -exec flag is not given, GOOS or GOARCH is different from the system
default, and a program named go_$GOOS_$GOARCH_exec can be found
on the current search path, 'go run' invokes the binary using that program,
......
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