cmdline tools: Auto-generate doc.go file using "go generate".
Originally I had planned to write yet another cmdline program
that would take the directory containing the main package for
each cmdline tool, and generate the doc.go file by running help
for the tool.
However I realized we should use "go run" to run the tool, to
ensure we're running the most recent version of the code. At
which point it's simpler just to run bash to run the tool and
generate the doc.go file.
Also fixed the help topic header, so that godoc recognizes it as
a section header. Specifically it isn't allowed to include
parens, but is allowed to include a dash.
Change-Id: Ie1980263d42be8e85ee7c6709812f62d83df83d8
diff --git a/lib/cmdline/cmdline.go b/lib/cmdline/cmdline.go
index 74245f2..ae6fa1b 100644
--- a/lib/cmdline/cmdline.go
+++ b/lib/cmdline/cmdline.go
@@ -308,7 +308,7 @@
}
for _, topic := range cmd.Topics {
// Title-case required for godoc to recognize this as a section header.
- header := strings.Title(namePath(cmd) + " " + topic.Name + " (Help Topic)")
+ header := strings.Title(namePath(cmd)+" "+topic.Name) + " - help topic"
lineBreak(w, style)
fmt.Fprintf(w, "%s\n\n", header)
printLong(w, topic.Long)
diff --git a/lib/cmdline/cmdline_test.go b/lib/cmdline/cmdline_test.go
index 255f1d5..370d478 100644
--- a/lib/cmdline/cmdline_test.go
+++ b/lib/cmdline/cmdline_test.go
@@ -802,7 +802,7 @@
The echoopt flags are:
-n=false: Do not output trailing newline
================================================================================
-Toplevelprog Echoprog Topic3 (Help Topic)
+Toplevelprog Echoprog Topic3 - help topic
Help topic 3 long.
================================================================================
@@ -829,11 +829,11 @@
The help flags are:
-style=text: The formatting style for help output, either "text" or "godoc".
================================================================================
-Toplevelprog Topic1 (Help Topic)
+Toplevelprog Topic1 - help topic
Help topic 1 long.
================================================================================
-Toplevelprog Topic2 (Help Topic)
+Toplevelprog Topic2 - help topic
Help topic 2 long.
`,
@@ -932,7 +932,7 @@
The help flags are:
-style=text: The formatting style for help output, either "text" or "godoc".
================================================================================
-Toplevelprog Echoprog Topic3 (Help Topic)
+Toplevelprog Echoprog Topic3 - help topic
Help topic 3 long.
`,
diff --git a/tools/application/doc.go b/tools/application/doc.go
new file mode 100644
index 0000000..5c8f11f
--- /dev/null
+++ b/tools/application/doc.go
@@ -0,0 +1,85 @@
+// This file was auto-generated via go generate.
+// DO NOT UPDATE MANUALLY
+
+/*
+The application tool facilitates interaction with the veyron application
+repository.
+
+Usage:
+ application <command>
+
+The application commands are:
+ match Shows the first matching envelope that matches the given profiles.
+ put Add the given envelope to the application for the given profiles.
+ remove removes the application envelope for the given profile.
+ edit edits the application envelope for the given profile.
+ help Display help for commands or topics
+Run "application help [command]" for command usage.
+
+The global flags are:
+ -alsologtostderr=true: log to standard error as well as files
+ -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
+ -log_dir=: if non-empty, write log files to this directory
+ -logtostderr=false: log to standard error instead of files
+ -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
+ -stderrthreshold=2: logs at or above this threshold go to stderr
+ -v=0: log level for V logs
+ -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
+ -vv=0: log level for V logs
+
+Application Match
+
+Shows the first matching envelope that matches the given profiles.
+
+Usage:
+ application match <application> <profiles>
+
+<application> is the full name of the application.
+<profiles> is a comma-separated list of profiles.
+
+Application Put
+
+Add the given envelope to the application for the given profiles.
+
+Usage:
+ application put <application> <profiles> <envelope>
+
+<application> is the full name of the application.
+<profiles> is a comma-separated list of profiles.
+<envelope> is the file that contains a JSON-encoded envelope.
+
+Application Remove
+
+removes the application envelope for the given profile.
+
+Usage:
+ application remove <application> <profile>
+
+<application> is the full name of the application.
+<profile> is a profile.
+
+Application Edit
+
+edits the application envelope for the given profile.
+
+Usage:
+ application edit <application> <profile>
+
+<application> is the full name of the application.
+<profile> is a profile.
+
+Application Help
+
+Help with no args displays the usage of the parent command.
+Help with args displays the usage of the specified sub-command or help topic.
+"help ..." recursively displays help for all commands and topics.
+
+Usage:
+ application help [flags] [command/topic ...]
+
+[command/topic ...] optionally identifies a specific sub-command or help topic.
+
+The help flags are:
+ -style=text: The formatting style for help output, either "text" or "godoc".
+*/
+package main
diff --git a/tools/application/main.go b/tools/application/main.go
index 2bcd6f3..568f32e 100644
--- a/tools/application/main.go
+++ b/tools/application/main.go
@@ -1,85 +1,12 @@
-// Below is the output from $(application help -style=godoc ...)
+// The following enables go generate to generate the doc.go file.
+// Things to look out for:
+// 1) go:generate evaluates double-quoted strings into a single argument.
+// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
+// 3) We generate into a *.tmp file first, otherwise go run will pick up the
+// initially empty *.go file, and fail.
+//
+//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
-/*
-The application tool facilitates interaction with the veyron application
-repository.
-
-Usage:
- application <command>
-
-The application commands are:
- match Shows the first matching envelope that matches the given profiles.
- put Add the given envelope to the application for the given profiles.
- remove removes the application envelope for the given profile.
- edit edits the application envelope for the given profile.
- help Display help for commands
-
-The global flags are:
- -alsologtostderr=true: log to standard error as well as files
- -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
- -log_dir=: if non-empty, write log files to this directory
- -logtostderr=false: log to standard error instead of files
- -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
- -stderrthreshold=2: logs at or above this threshold go to stderr
- -v=0: log level for V logs
- -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
- -vv=0: log level for V logs
-
-Application Match
-
-Shows the first matching envelope that matches the given profiles.
-
-Usage:
- application match <application> <profiles>
-
-<application> is the full name of the application.
-<profiles> is a comma-separated list of profiles.
-
-Application Put
-
-Add the given envelope to the application for the given profiles.
-
-Usage:
- application put <application> <profiles> <envelope>
-
-<application> is the full name of the application.
-<profiles> is a comma-separated list of profiles.
-<envelope> is the file that contains a JSON-encoded envelope.
-
-Application Remove
-
-removes the application envelope for the given profile.
-
-Usage:
- application remove <application> <profile>
-
-<application> is the full name of the application.
-<profile> is a profile.
-
-Application Edit
-
-edits the application envelope for the given profile.
-
-Usage:
- application edit <application> <profile>
-
-<application> is the full name of the application.
-<profile> is a profile.
-
-Application Help
-
-Help displays usage descriptions for this command, or usage descriptions for
-sub-commands.
-
-Usage:
- application help [flags] [command ...]
-
-[command ...] is an optional sequence of commands to display detailed usage.
-The special-case "help ..." recursively displays help for all commands.
-
-The help flags are:
- -style=text: The formatting style for help output, either "text" or "godoc".
-*/
package main
import (
diff --git a/tools/binary/doc.go b/tools/binary/doc.go
new file mode 100644
index 0000000..04afd49
--- /dev/null
+++ b/tools/binary/doc.go
@@ -0,0 +1,73 @@
+// This file was auto-generated via go generate.
+// DO NOT UPDATE MANUALLY
+
+/*
+The binary tool facilitates interaction with the veyron binary repository.
+
+Usage:
+ binary <command>
+
+The binary commands are:
+ delete Delete binary
+ download Download binary
+ upload Upload binary
+ help Display help for commands or topics
+Run "binary help [command]" for command usage.
+
+The global flags are:
+ -alsologtostderr=true: log to standard error as well as files
+ -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
+ -log_dir=: if non-empty, write log files to this directory
+ -logtostderr=false: log to standard error instead of files
+ -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
+ -stderrthreshold=2: logs at or above this threshold go to stderr
+ -v=0: log level for V logs
+ -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
+ -vv=0: log level for V logs
+
+Binary Delete
+
+Delete connects to the binary repository and deletes the specified binary
+
+Usage:
+ binary delete <von>
+
+<von> is the veyron object name of the binary to delete
+
+Binary Download
+
+Download connects to the binary repository, downloads the specified binary, and
+writes it to a file.
+
+Usage:
+ binary download <von> <filename>
+
+<von> is the veyron object name of the binary to download
+<filename> is the name of the file where the binary will be written
+
+Binary Upload
+
+Upload connects to the binary repository and uploads the binary of the specified
+file. When successful, it writes the name of the new binary to stdout.
+
+Usage:
+ binary upload <von> <filename>
+
+<von> is the veyron object name of the binary to upload
+<filename> is the name of the file to upload
+
+Binary Help
+
+Help with no args displays the usage of the parent command.
+Help with args displays the usage of the specified sub-command or help topic.
+"help ..." recursively displays help for all commands and topics.
+
+Usage:
+ binary help [flags] [command/topic ...]
+
+[command/topic ...] optionally identifies a specific sub-command or help topic.
+
+The help flags are:
+ -style=text: The formatting style for help output, either "text" or "godoc".
+*/
+package main
diff --git a/tools/binary/main.go b/tools/binary/main.go
index a206d11..3edd674 100644
--- a/tools/binary/main.go
+++ b/tools/binary/main.go
@@ -1,73 +1,12 @@
-// Below is the output from $(binary help -style=godoc ...)
+// The following enables go generate to generate the doc.go file.
+// Things to look out for:
+// 1) go:generate evaluates double-quoted strings into a single argument.
+// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
+// 3) We generate into a *.tmp file first, otherwise go run will pick up the
+// initially empty *.go file, and fail.
+//
+//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
-/*
-The binary tool facilitates interaction with the veyron binary repository.
-
-Usage:
- binary <command>
-
-The binary commands are:
- delete Delete binary
- download Download binary
- upload Upload binary
- help Display help for commands
-
-The global flags are:
- -alsologtostderr=true: log to standard error as well as files
- -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
- -log_dir=: if non-empty, write log files to this directory
- -logtostderr=false: log to standard error instead of files
- -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
- -stderrthreshold=2: logs at or above this threshold go to stderr
- -v=0: log level for V logs
- -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
- -vv=0: log level for V logs
-
-Binary Delete
-
-Delete connects to the binary repository and deletes the specified binary
-
-Usage:
- binary delete <von>
-
-<von> is the veyron object name of the binary to delete
-
-Binary Download
-
-Download connects to the binary repository, downloads the specified binary, and
-writes it to a file.
-
-Usage:
- binary download <von> <filename>
-
-<von> is the veyron object name of the binary to download
-<filename> is the name of the file where the binary will be written
-
-Binary Upload
-
-Upload connects to the binary repository and uploads the binary of the specified
-file. When successful, it writes the name of the new binary to stdout.
-
-Usage:
- binary upload <von> <filename>
-
-<von> is the veyron object name of the binary to upload
-<filename> is the name of the file to upload
-
-Binary Help
-
-Help displays usage descriptions for this command, or usage descriptions for
-sub-commands.
-
-Usage:
- binary help [flags] [command ...]
-
-[command ...] is an optional sequence of commands to display detailed usage.
-The special-case "help ..." recursively displays help for all commands.
-
-The help flags are:
- -style=text: The formatting style for help output, either "text" or "godoc".
-*/
package main
import (
diff --git a/tools/build/doc.go b/tools/build/doc.go
new file mode 100644
index 0000000..9d7fc7e
--- /dev/null
+++ b/tools/build/doc.go
@@ -0,0 +1,61 @@
+// This file was auto-generated via go generate.
+// DO NOT UPDATE MANUALLY
+
+/*
+The build tool tool facilitates interaction with the veyron build server.
+
+Usage:
+ build <command>
+
+The build commands are:
+ build Build veyron Go packages
+ help Display help for commands or topics
+Run "build help [command]" for command usage.
+
+The global flags are:
+ -alsologtostderr=true: log to standard error as well as files
+ -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
+ -log_dir=: if non-empty, write log files to this directory
+ -logtostderr=false: log to standard error instead of files
+ -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
+ -stderrthreshold=2: logs at or above this threshold go to stderr
+ -v=0: log level for V logs
+ -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
+ -vv=0: log level for V logs
+
+Build Build
+
+Build veyron Go packages using a remote build server. The command
+collects all source code files that are not part of the Go standard
+library that the target packages depend on, sends them to a build
+server, and receives the built binaries.
+
+Usage:
+ build build [flags] <name> <packages>
+
+<name> is a veyron object name of a build server
+<packages> is a list of packages to build, specified as arguments for
+each command. The format is similar to the go tool. In its simplest
+form each package is an import path; e.g. "veyron/tools/build". A
+package that ends with "..." does a wildcard match against all
+packages with that prefix.
+
+The build flags are:
+ -arch=amd64: Target architecture.
+ -os=linux: Target operating system.
+
+Build Help
+
+Help with no args displays the usage of the parent command.
+Help with args displays the usage of the specified sub-command or help topic.
+"help ..." recursively displays help for all commands and topics.
+
+Usage:
+ build help [flags] [command/topic ...]
+
+[command/topic ...] optionally identifies a specific sub-command or help topic.
+
+The help flags are:
+ -style=text: The formatting style for help output, either "text" or "godoc".
+*/
+package main
diff --git a/tools/build/main.go b/tools/build/main.go
index 696e982..c89bbd0 100644
--- a/tools/build/main.go
+++ b/tools/build/main.go
@@ -1,61 +1,12 @@
-// Below is the output from $(build help -style=godoc ...)
+// The following enables go generate to generate the doc.go file.
+// Things to look out for:
+// 1) go:generate evaluates double-quoted strings into a single argument.
+// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
+// 3) We generate into a *.tmp file first, otherwise go run will pick up the
+// initially empty *.go file, and fail.
+//
+//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
-/*
-The build tool tool facilitates interaction with the veyron build server.
-
-Usage:
- build <command>
-
-The build commands are:
- build Build veyron Go packages
- help Display help for commands
-
-The global flags are:
- -alsologtostderr=true: log to standard error as well as files
- -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
- -log_dir=: if non-empty, write log files to this directory
- -logtostderr=false: log to standard error instead of files
- -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
- -stderrthreshold=2: logs at or above this threshold go to stderr
- -v=0: log level for V logs
- -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
- -vv=0: log level for V logs
-
-Build Build
-
-Build veyron Go packages using a remote build server. The command
-collects all source code files that are not part of the Go standard
-library that the target packages depend on, sends them to a build
-server, and receives the built binaries.
-
-Usage:
- build build [flags] <name> <packages>
-
-<name> is a veyron object name of a build server
-<packages> is a list of packages to build, specified as arguments for
-each command. The format is similar to the go tool. In its simplest
-form each package is an import path; e.g. "veyron/tools/build". A
-package that ends with "..." does a wildcard match against all
-packages with that prefix.
-
-The build flags are:
- -arch=amd64: Target architecture.
- -os=linux: Target operating system.
-
-Build Help
-
-Help displays usage descriptions for this command, or usage descriptions for
-sub-commands.
-
-Usage:
- build help [flags] [command ...]
-
-[command ...] is an optional sequence of commands to display detailed usage.
-The special-case "help ..." recursively displays help for all commands.
-
-The help flags are:
- -style=text: The formatting style for help output, either "text" or "godoc".
-*/
package main
import (
diff --git a/tools/debug/doc.go b/tools/debug/doc.go
new file mode 100644
index 0000000..e611553
--- /dev/null
+++ b/tools/debug/doc.go
@@ -0,0 +1,162 @@
+// This file was auto-generated via go generate.
+// DO NOT UPDATE MANUALLY
+
+/*
+Command-line tool for interacting with the debug server.
+
+Usage:
+ debug <command>
+
+The debug commands are:
+ glob Returns all matching entries from the namespace
+ logs Accesses log files
+ stats Accesses stats
+ pprof Accesses profiling data
+ help Display help for commands or topics
+Run "debug help [command]" for command usage.
+
+The global flags are:
+ -alsologtostderr=true: log to standard error as well as files
+ -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
+ -log_dir=: if non-empty, write log files to this directory
+ -logtostderr=false: log to standard error instead of files
+ -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
+ -stderrthreshold=2: logs at or above this threshold go to stderr
+ -v=0: log level for V logs
+ -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
+ -vv=0: log level for V logs
+
+Debug Glob
+
+Returns all matching entries from the namespace.
+
+Usage:
+ debug glob <pattern> ...
+
+<pattern> is a glob pattern to match.
+
+Debug Logs
+
+Accesses log files
+
+Usage:
+ debug logs <command>
+
+The logs commands are:
+ read Reads the content of a log file object.
+ size Returns the size of the a log file object
+
+Debug Logs Read
+
+Reads the content of a log file object.
+
+Usage:
+ debug logs read [flags] <name>
+
+<name> is the name of the log file object.
+
+The read flags are:
+ -f=false: When true, read will wait for new log entries when it reaches the end of the file.
+ -n=-1: The number of log entries to read.
+ -o=0: The position, in bytes, from which to start reading the log file.
+ -v=false: When true, read will be more verbose.
+
+Debug Logs Size
+
+Returns the size of the a log file object.
+
+Usage:
+ debug logs size <name>
+
+<name> is the name of the log file object.
+
+Debug Stats
+
+Accesses stats
+
+Usage:
+ debug stats <command>
+
+The stats commands are:
+ value Returns the value of the a stats object
+ watchglob Returns a stream of all matching entries and their values
+
+Debug Stats Value
+
+Returns the value of the a stats object.
+
+Usage:
+ debug stats value [flags] <name>
+
+<name> is the name of the stats object.
+
+The value flags are:
+ -raw=false: When true, the command will display the raw value of the object.
+ -type=false: When true, the type of the values will be displayed.
+
+Debug Stats Watchglob
+
+Returns a stream of all matching entries and their values
+
+Usage:
+ debug stats watchglob [flags] <pattern> ...
+
+<pattern> is a glob pattern to match.
+
+The watchglob flags are:
+ -raw=false: When true, the command will display the raw value of the object.
+ -type=false: When true, the type of the values will be displayed.
+
+Debug Pprof
+
+Accesses profiling data
+
+Usage:
+ debug pprof <command>
+
+The pprof commands are:
+ run Runs the pprof tool
+ proxy Runs an http proxy to a pprof object
+
+Debug Pprof Run
+
+Runs the pprof tool
+
+Usage:
+ debug pprof run [flags] <name> <profile> [passthru args] ...
+
+<name> is the name of the pprof object.
+<profile> the name of the profile to use.
+
+All the [passthru args] are passed to the pprof tool directly, e.g.
+
+$ debug pprof run a/b/c heap --text --lines
+$ debug pprof run a/b/c profile -gv
+
+The run flags are:
+ -pprofcmd=veyron go tool pprof: The pprof command to use.
+
+Debug Pprof Proxy
+
+Runs an http proxy to a pprof object
+
+Usage:
+ debug pprof proxy <name>
+
+<name> is the name of the pprof object.
+
+Debug Help
+
+Help with no args displays the usage of the parent command.
+Help with args displays the usage of the specified sub-command or help topic.
+"help ..." recursively displays help for all commands and topics.
+
+Usage:
+ debug help [flags] [command/topic ...]
+
+[command/topic ...] optionally identifies a specific sub-command or help topic.
+
+The help flags are:
+ -style=text: The formatting style for help output, either "text" or "godoc".
+*/
+package main
diff --git a/tools/debug/main.go b/tools/debug/main.go
index bc021ef..ffa2f5b 100644
--- a/tools/debug/main.go
+++ b/tools/debug/main.go
@@ -1,4 +1,12 @@
-// A command-line tool to interface with the debug server.
+// The following enables go generate to generate the doc.go file.
+// Things to look out for:
+// 1) go:generate evaluates double-quoted strings into a single argument.
+// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
+// 3) We generate into a *.tmp file first, otherwise go run will pick up the
+// initially empty *.go file, and fail.
+//
+//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
+
package main
import (
diff --git a/tools/identity/doc.go b/tools/identity/doc.go
new file mode 100644
index 0000000..ed0b8e2
--- /dev/null
+++ b/tools/identity/doc.go
@@ -0,0 +1,119 @@
+// This file was auto-generated via go generate.
+// DO NOT UPDATE MANUALLY
+
+/*
+The identity tool helps create and manage keys and blessings that are used for
+identification in veyron.
+
+Usage:
+ identity <command>
+
+The identity commands are:
+ print Print out information about the provided identity
+ generate Generate an identity with a newly minted private key
+ bless Bless another identity with your own
+ seekblessing Seek a blessing from the default veyron identity provider
+ help Display help for commands or topics
+Run "identity help [command]" for command usage.
+
+The global flags are:
+ -alsologtostderr=true: log to standard error as well as files
+ -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
+ -log_dir=: if non-empty, write log files to this directory
+ -logtostderr=false: log to standard error instead of files
+ -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
+ -stderrthreshold=2: logs at or above this threshold go to stderr
+ -v=0: log level for V logs
+ -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
+ -vv=0: log level for V logs
+
+Identity Print
+
+Print dumps out information about the identity encoded in the provided file,
+or if no filename is provided, then the identity that would be used by binaries
+started in the same environment.
+
+Usage:
+ identity print [<file>]
+
+<file> is the path to a file containing a base64-encoded, VOM encoded identity,
+typically obtained from this tool. - is used for STDIN and an empty string
+implies the identity encoded in the environment.
+
+Identity Generate
+
+Generate a new private key and create an identity that binds <name> to
+this key.
+
+Since the generated identity has a newly minted key, it will be typically
+unusable at other veyron services as those services have placed no trust
+in this key. In such cases, you likely want to seek a blessing for this
+generated identity using the 'bless' command.
+
+Usage:
+ identity generate [<name>]
+
+<name> is the name to bind the newly minted private key to. If not specified,
+a name will be generated based on the hostname of the machine and the name of
+the user running this command.
+
+Identity Bless
+
+Bless uses the identity of the tool (either from an environment variable or
+explicitly specified using --with) to bless another identity encoded in a
+file (or STDIN). No caveats are applied to this blessing other than expiration,
+which is specified with --for.
+
+The output consists of a base64-vom encoded security.PrivateID or security.PublicID,
+depending on what was provided as input.
+
+For example, if the tool has an identity veyron/user/device, then
+bless /tmp/blessee batman
+will generate a blessing with the name veyron/user/device/batman
+
+The identity of the tool can be specified with the --with flag:
+bless --with /tmp/id /tmp/blessee batman
+
+Usage:
+ identity bless [flags] <file> <name>
+
+<file> is the name of the file containing a base64-vom encoded security.PublicID
+or security.PrivateID
+
+<name> is the name to use for the blessing.
+
+The bless flags are:
+ -for=8760h0m0s: Expiry time of blessing (defaults to 1 year)
+ -with=: Path to file containing identity to bless with (or - for STDIN)
+
+Identity Seekblessing
+
+Seeks a blessing from a default, hardcoded Veyron identity provider which
+requires the caller to first authenticate with Google using OAuth. Simply
+run the command to see what happens.
+
+The blessing is sought for the identity that this tool is using. An alternative
+can be provided with the --for flag.
+
+Usage:
+ identity seekblessing [flags]
+
+The seekblessing flags are:
+ -for=: Path to file containing identity to bless (or - for STDIN)
+ -from=https://proxy.envyor.com:8125/google: URL to use to begin the seek blessings process
+
+Identity Help
+
+Help with no args displays the usage of the parent command.
+Help with args displays the usage of the specified sub-command or help topic.
+"help ..." recursively displays help for all commands and topics.
+
+Usage:
+ identity help [flags] [command/topic ...]
+
+[command/topic ...] optionally identifies a specific sub-command or help topic.
+
+The help flags are:
+ -style=text: The formatting style for help output, either "text" or "godoc".
+*/
+package main
diff --git a/tools/identity/main.go b/tools/identity/main.go
index 4585fd5..24c8569 100644
--- a/tools/identity/main.go
+++ b/tools/identity/main.go
@@ -1,120 +1,14 @@
-// Below is the output from $(identity help -style=godoc ...)
+// The following enables go generate to generate the doc.go file.
+// Things to look out for:
+// 1) go:generate evaluates double-quoted strings into a single argument.
+// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
+// 3) We generate into a *.tmp file first, otherwise "go run" will pick up the
+// initially empty *.go file, and fail.
+// 4) Since "go run" ignores build directives, we must manually filter out
+// main_*.go for different platforms.
+//
+//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run `echo *.go | tr ' ' '\n' | grep -v main_darwin.go` help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
-/*
-The identity tool helps create and manage keys and blessings that are used for
-identification in veyron.
-
-Usage:
- identity <command>
-
-The identity commands are:
- print Print out information about the provided identity
- generate Generate an identity with a newly minted private key
- bless Bless another identity with your own
- seekblessing Seek a blessing from the default veyron identity provider
- help Display help for commands
-
-The global flags are:
- -alsologtostderr=true: log to standard error as well as files
- -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
- -log_dir=: if non-empty, write log files to this directory
- -logtostderr=false: log to standard error instead of files
- -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
- -stderrthreshold=2: logs at or above this threshold go to stderr
- -v=0: log level for V logs
- -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
- -vv=0: log level for V logs
-
-Identity Print
-
-Print dumps out information about the identity encoded in the provided file,
-or if no filename is provided, then the identity that would be used by binaries
-started in the same environment.
-
-Usage:
- identity print [<file>]
-
-<file> is the path to a file containing a base64-encoded, VOM encoded identity,
-typically obtained from this tool. - is used for STDIN and an empty string
-implies the identity encoded in the environment.
-
-Identity Generate
-
-Generate a new private key and create an identity that binds <name> to
-this key.
-
-Since the generated identity has a newly minted key, it will be typically
-unusable at other veyron services as those services have placed no trust
-in this key. In such cases, you likely want to seek a blessing for this
-generated identity using the 'bless' command.
-
-Usage:
- identity generate [<name>]
-
-<name> is the name to bind the newly minted private key to. If not specified,
-a name will be generated based on the hostname of the machine and the name of
-the user running this command.
-
-Identity Bless
-
-Bless uses the identity of the tool (either from an environment variable or
-explicitly specified using --with) to bless another identity encoded in a
-file (or STDIN). No caveats are applied to this blessing other than expiration,
-which is specified with --for.
-
-The output consists of a base64-vom encoded security.PrivateID or security.PublicID,
-depending on what was provided as input.
-
-For example, if the tool has an identity veyron/user/device, then
-bless /tmp/blessee batman
-will generate a blessing with the name veyron/user/device/batman
-
-The identity of the tool can be specified with the --with flag:
-bless --with /tmp/id /tmp/blessee batman
-
-Usage:
- identity bless [flags] <file> <name>
-
-<file> is the name of the file containing a base64-vom encoded security.PublicID
-or security.PrivateID
-
-<name> is the name to use for the blessing.
-
-The bless flags are:
- -for=8760h0m0s: Expiry time of blessing (defaults to 1 year)
- -with=: Path to file containing identity to bless with (or - for STDIN)
-
-Identity Seekblessing
-
-Seeks a blessing from a default, hardcoded Veyron identity provider which
-requires the caller to first authenticate with Google using OAuth. Simply
-run the command to see what happens.
-
-The blessing is sought for the identity that this tool is using. An alternative
-can be provided with the --for flag.
-
-Usage:
- identity seekblessing [flags]
-
-The seekblessing flags are:
- -clientid=761523829214-4ms7bae18ef47j6590u9ncs19ffuo7b3.apps.googleusercontent.com: OAuth client ID used to make OAuth request for an authorization code
- -for=: Path to file containing identity to bless (or - for STDIN)
- -from=/proxy.envyor.com:8101/identity/veyron-test/google: Object name of Veyron service running the identity.OAuthBlesser service to seek blessings from
-
-Identity Help
-
-Help displays usage descriptions for this command, or usage descriptions for
-sub-commands.
-
-Usage:
- identity help [flags] [command ...]
-
-[command ...] is an optional sequence of commands to display detailed usage.
-The special-case "help ..." recursively displays help for all commands.
-
-The help flags are:
- -style=text: The formatting style for help output, either "text" or "godoc".
-*/
package main
import (
diff --git a/tools/mounttable/doc.go b/tools/mounttable/doc.go
new file mode 100644
index 0000000..fc63e5a
--- /dev/null
+++ b/tools/mounttable/doc.go
@@ -0,0 +1,85 @@
+// This file was auto-generated via go generate.
+// DO NOT UPDATE MANUALLY
+
+/*
+The mounttable tool facilitates interaction with a Veyron mount table.
+
+Usage:
+ mounttable <command>
+
+The mounttable commands are:
+ glob returns all matching entries in the mount table
+ mount Mounts a server <name> onto a mount table
+ unmount removes server <name> from the mount table
+ resolvestep takes the next step in resolving a name.
+ help Display help for commands or topics
+Run "mounttable help [command]" for command usage.
+
+The global flags are:
+ -alsologtostderr=true: log to standard error as well as files
+ -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
+ -log_dir=: if non-empty, write log files to this directory
+ -logtostderr=false: log to standard error instead of files
+ -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
+ -stderrthreshold=2: logs at or above this threshold go to stderr
+ -v=0: log level for V logs
+ -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
+ -vv=0: log level for V logs
+
+Mounttable Glob
+
+returns all matching entries in the mount table
+
+Usage:
+ mounttable glob <mount name> <pattern>
+
+<mount name> is a mount name on a mount table.
+<pattern> is a glob pattern that is matched against all the entries below the
+specified mount name.
+
+Mounttable Mount
+
+Mounts a server <name> onto a mount table
+
+Usage:
+ mounttable mount <mount name> <name> <ttl>
+
+<mount name> is a mount name on a mount table.
+<name> is the rooted object name of the server.
+<ttl> is the TTL of the new entry. It is a decimal number followed by a unit
+suffix (s, m, h). A value of 0s represents an infinite duration.
+
+Mounttable Unmount
+
+removes server <name> from the mount table
+
+Usage:
+ mounttable unmount <mount name> <name>
+
+<mount name> is a mount name on a mount table.
+<name> is the rooted object name of the server.
+
+Mounttable Resolvestep
+
+takes the next step in resolving a name.
+
+Usage:
+ mounttable resolvestep <mount name>
+
+<mount name> is a mount name on a mount table.
+
+Mounttable Help
+
+Help with no args displays the usage of the parent command.
+Help with args displays the usage of the specified sub-command or help topic.
+"help ..." recursively displays help for all commands and topics.
+
+Usage:
+ mounttable help [flags] [command/topic ...]
+
+[command/topic ...] optionally identifies a specific sub-command or help topic.
+
+The help flags are:
+ -style=text: The formatting style for help output, either "text" or "godoc".
+*/
+package main
diff --git a/tools/mounttable/main.go b/tools/mounttable/main.go
index 80216f1..741e62f 100644
--- a/tools/mounttable/main.go
+++ b/tools/mounttable/main.go
@@ -1,85 +1,12 @@
-// Below is the output from $(mounttable help -style=godoc ...)
+// The following enables go generate to generate the doc.go file.
+// Things to look out for:
+// 1) go:generate evaluates double-quoted strings into a single argument.
+// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
+// 3) We generate into a *.tmp file first, otherwise go run will pick up the
+// initially empty *.go file, and fail.
+//
+//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
-/*
-The mounttable tool facilitates interaction with a Veyron mount table.
-
-Usage:
- mounttable <command>
-
-The mounttable commands are:
- glob returns all matching entries in the mount table
- mount Mounts a server <name> onto a mount table
- unmount removes server <name> from the mount table
- resolvestep takes the next step in resolving a name.
- help Display help for commands
-
-The global flags are:
- -alsologtostderr=true: log to standard error as well as files
- -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
- -log_dir=: if non-empty, write log files to this directory
- -logtostderr=false: log to standard error instead of files
- -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
- -stderrthreshold=2: logs at or above this threshold go to stderr
- -v=0: log level for V logs
- -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
- -vv=0: log level for V logs
-
-Mounttable Glob
-
-returns all matching entries in the mount table
-
-Usage:
- mounttable glob <mount name> <pattern>
-
-<mount name> is a mount name on a mount table.
-<pattern> is a glob pattern that is matched against all the entries below the
-specified mount name.
-
-Mounttable Mount
-
-Mounts a server <name> onto a mount table
-
-Usage:
- mounttable mount <mount name> <name> <ttl>
-
-<mount name> is a mount name on a mount table.
-<name> is the rooted object name of the server.
-<ttl> is the TTL of the new entry. It is a decimal number followed by a unit
-suffix (s, m, h). A value of 0s represents an infinite duration.
-
-Mounttable Unmount
-
-removes server <name> from the mount table
-
-Usage:
- mounttable unmount <mount name> <name>
-
-<mount name> is a mount name on a mount table.
-<name> is the rooted object name of the server.
-
-Mounttable Resolvestep
-
-takes the next step in resolving a name.
-
-Usage:
- mounttable resolvestep <mount name>
-
-<mount name> is a mount name on a mount table.
-
-Mounttable Help
-
-Help displays usage descriptions for this command, or usage descriptions for
-sub-commands.
-
-Usage:
- mounttable help [flags] [command ...]
-
-[command ...] is an optional sequence of commands to display detailed usage.
-The special-case "help ..." recursively displays help for all commands.
-
-The help flags are:
- -style=text: The formatting style for help output, either "text" or "godoc".
-*/
package main
import (
diff --git a/tools/namespace/doc.go b/tools/namespace/doc.go
new file mode 100644
index 0000000..addc28d
--- /dev/null
+++ b/tools/namespace/doc.go
@@ -0,0 +1,108 @@
+// This file was auto-generated via go generate.
+// DO NOT UPDATE MANUALLY
+
+/*
+The namespace tool facilitates interaction with the Veyron namespace.
+
+The namespace roots are set from environment variables that have a name
+starting with NAMESPACE_ROOT, e.g. NAMESPACE_ROOT, NAMESPACE_ROOT_2,
+NAMESPACE_ROOT_GOOGLE, etc.
+
+Usage:
+ namespace <command>
+
+The namespace commands are:
+ glob Returns all matching entries from the namespace
+ mount Adds a server to the namespace
+ unmount Removes a server from the namespace
+ resolve Translates a object name to its object address(es)
+ resolvetomt Finds the address of the mounttable that holds an object name
+ unresolve Returns the rooted object names for the given object name
+ help Display help for commands or topics
+Run "namespace help [command]" for command usage.
+
+The global flags are:
+ -alsologtostderr=true: log to standard error as well as files
+ -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
+ -log_dir=: if non-empty, write log files to this directory
+ -logtostderr=false: log to standard error instead of files
+ -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
+ -stderrthreshold=2: logs at or above this threshold go to stderr
+ -v=0: log level for V logs
+ -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
+ -vv=0: log level for V logs
+
+Namespace Glob
+
+Returns all matching entries from the namespace.
+
+Usage:
+ namespace glob <pattern>
+
+<pattern> is a glob pattern that is matched against all the names below the
+specified mount name.
+
+Namespace Mount
+
+Adds server <server> to the namespace with name <name>.
+
+Usage:
+ namespace mount <name> <server> <ttl>
+
+<name> is the name to add to the namespace.
+<server> is the object address of the server to add.
+<ttl> is the TTL of the new entry. It is a decimal number followed by a unit
+suffix (s, m, h). A value of 0s represents an infinite duration.
+
+Namespace Unmount
+
+Removes server <server> with name <name> from the namespace.
+
+Usage:
+ namespace unmount <name> <server>
+
+<name> is the name to remove from the namespace.
+<server> is the object address of the server to remove.
+
+Namespace Resolve
+
+Translates a object name to its object address(es).
+
+Usage:
+ namespace resolve <name>
+
+<name> is the name to resolve.
+
+Namespace Resolvetomt
+
+Finds the address of the mounttable that holds an object name.
+
+Usage:
+ namespace resolvetomt <name>
+
+<name> is the name to resolve.
+
+Namespace Unresolve
+
+Returns the rooted object names for the given object name.
+
+Usage:
+ namespace unresolve <name>
+
+<name> is the object name to unresolve.
+
+Namespace Help
+
+Help with no args displays the usage of the parent command.
+Help with args displays the usage of the specified sub-command or help topic.
+"help ..." recursively displays help for all commands and topics.
+
+Usage:
+ namespace help [flags] [command/topic ...]
+
+[command/topic ...] optionally identifies a specific sub-command or help topic.
+
+The help flags are:
+ -style=text: The formatting style for help output, either "text" or "godoc".
+*/
+package main
diff --git a/tools/namespace/main.go b/tools/namespace/main.go
index babf6ca..9ed1881 100644
--- a/tools/namespace/main.go
+++ b/tools/namespace/main.go
@@ -1,108 +1,12 @@
-// Below is the output from $(namespace help -style=godoc ...)
+// The following enables go generate to generate the doc.go file.
+// Things to look out for:
+// 1) go:generate evaluates double-quoted strings into a single argument.
+// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
+// 3) We generate into a *.tmp file first, otherwise go run will pick up the
+// initially empty *.go file, and fail.
+//
+//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
-/*
-The namespace tool facilitates interaction with the Veyron namespace.
-
-The namespace roots are set from environment variables that have a name
-starting with NAMESPACE_ROOT, e.g. NAMESPACE_ROOT, NAMESPACE_ROOT_2,
-NAMESPACE_ROOT_GOOGLE, etc.
-
-Usage:
- namespace <command>
-
-The namespace commands are:
- glob Returns all matching entries from the namespace
- mount Adds a server to the namespace
- unmount Removes a server from the namespace
- resolve Translates a object name to its object address(es)
- resolvetomt Finds the address of the mounttable that holds an object name
- unresolve Returns the rooted object names for the given object name
- help Display help for commands
-
-The global flags are:
- -alsologtostderr=true: log to standard error as well as files
- -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
- -log_dir=: if non-empty, write log files to this directory
- -logtostderr=false: log to standard error instead of files
- -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
- -stderrthreshold=2: logs at or above this threshold go to stderr
- -v=0: log level for V logs
- -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
- -vv=0: log level for V logs
-
-Namespace Glob
-
-Returns all matching entries from the namespace.
-
-Usage:
- namespace glob <pattern>
-
-<pattern> is a glob pattern that is matched against all the names below the
-specified mount name.
-
-Namespace Mount
-
-Adds server <server> to the namespace with name <name>.
-
-Usage:
- namespace mount <name> <server> <ttl>
-
-<name> is the name to add to the namespace.
-<server> is the object address of the server to add.
-<ttl> is the TTL of the new entry. It is a decimal number followed by a unit
-suffix (s, m, h). A value of 0s represents an infinite duration.
-
-Namespace Unmount
-
-Removes server <server> with name <name> from the namespace.
-
-Usage:
- namespace unmount <name> <server>
-
-<name> is the name to remove from the namespace.
-<server> is the object address of the server to remove.
-
-Namespace Resolve
-
-Translates a object name to its object address(es).
-
-Usage:
- namespace resolve <name>
-
-<name> is the name to resolve.
-
-Namespace Resolvetomt
-
-Finds the address of the mounttable that holds an object name.
-
-Usage:
- namespace resolvetomt <name>
-
-<name> is the name to resolve.
-
-Namespace Unresolve
-
-Returns the rooted object names for the given object name.
-
-Usage:
- namespace unresolve <name>
-
-<name> is the object name to unresolve.
-
-Namespace Help
-
-Help displays usage descriptions for this command, or usage descriptions for
-sub-commands.
-
-Usage:
- namespace help [flags] [command ...]
-
-[command ...] is an optional sequence of commands to display detailed usage.
-The special-case "help ..." recursively displays help for all commands.
-
-The help flags are:
- -style=text: The formatting style for help output, either "text" or "godoc".
-*/
package main
import (
diff --git a/tools/profile/doc.go b/tools/profile/doc.go
new file mode 100644
index 0000000..6a71540
--- /dev/null
+++ b/tools/profile/doc.go
@@ -0,0 +1,89 @@
+// This file was auto-generated via go generate.
+// DO NOT UPDATE MANUALLY
+
+/*
+The profile tool facilitates interaction with the veyron profile repository.
+
+Usage:
+ profile <command>
+
+The profile commands are:
+ label Shows a human-readable profile key for the profile.
+ description Shows a human-readable profile description for the profile.
+ spec Shows the specification of the profile.
+ put Sets a placeholder specification for the profile.
+ remove removes the profile specification for the profile.
+ help Display help for commands or topics
+Run "profile help [command]" for command usage.
+
+The global flags are:
+ -alsologtostderr=true: log to standard error as well as files
+ -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
+ -log_dir=: if non-empty, write log files to this directory
+ -logtostderr=false: log to standard error instead of files
+ -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
+ -stderrthreshold=2: logs at or above this threshold go to stderr
+ -v=0: log level for V logs
+ -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
+ -vv=0: log level for V logs
+
+Profile Label
+
+Shows a human-readable profile key for the profile.
+
+Usage:
+ profile label <profile>
+
+<profile> is the full name of the profile.
+
+Profile Description
+
+Shows a human-readable profile description for the profile.
+
+Usage:
+ profile description <profile>
+
+<profile> is the full name of the profile.
+
+Profile Spec
+
+Shows the specification of the profile.
+
+Usage:
+ profile spec <profile>
+
+<profile> is the full name of the profile.
+
+Profile Put
+
+Sets a placeholder specification for the profile.
+
+Usage:
+ profile put <profile>
+
+<profile> is the full name of the profile.
+
+Profile Remove
+
+removes the profile specification for the profile.
+
+Usage:
+ profile remove <profile>
+
+<profile> is the full name of the profile.
+
+Profile Help
+
+Help with no args displays the usage of the parent command.
+Help with args displays the usage of the specified sub-command or help topic.
+"help ..." recursively displays help for all commands and topics.
+
+Usage:
+ profile help [flags] [command/topic ...]
+
+[command/topic ...] optionally identifies a specific sub-command or help topic.
+
+The help flags are:
+ -style=text: The formatting style for help output, either "text" or "godoc".
+*/
+package main
diff --git a/tools/profile/main.go b/tools/profile/main.go
index f6cf6d2..2af525d 100644
--- a/tools/profile/main.go
+++ b/tools/profile/main.go
@@ -1,89 +1,12 @@
-// Below is the output from $(profile help -style=godoc ...)
+// The following enables go generate to generate the doc.go file.
+// Things to look out for:
+// 1) go:generate evaluates double-quoted strings into a single argument.
+// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
+// 3) We generate into a *.tmp file first, otherwise go run will pick up the
+// initially empty *.go file, and fail.
+//
+//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
-/*
-The profile tool facilitates interaction with the veyron profile repository.
-
-Usage:
- profile <command>
-
-The profile commands are:
- label Shows a human-readable profile key for the profile.
- description Shows a human-readable profile description for the profile.
- spec Shows the specification of the profile.
- put Sets a placeholder specification for the profile.
- remove removes the profile specification for the profile.
- help Display help for commands
-
-The global flags are:
- -alsologtostderr=true: log to standard error as well as files
- -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
- -log_dir=: if non-empty, write log files to this directory
- -logtostderr=false: log to standard error instead of files
- -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
- -stderrthreshold=2: logs at or above this threshold go to stderr
- -v=0: log level for V logs
- -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
- -vv=0: log level for V logs
-
-Profile Label
-
-Shows a human-readable profile key for the profile.
-
-Usage:
- profile label <profile>
-
-<profile> is the full name of the profile.
-
-Profile Description
-
-Shows a human-readable profile description for the profile.
-
-Usage:
- profile description <profile>
-
-<profile> is the full name of the profile.
-
-Profile Spec
-
-Shows the specification of the profile.
-
-Usage:
- profile spec <profile>
-
-<profile> is the full name of the profile.
-
-Profile Put
-
-Sets a placeholder specification for the profile.
-
-Usage:
- profile put <profile>
-
-<profile> is the full name of the profile.
-
-Profile Remove
-
-removes the profile specification for the profile.
-
-Usage:
- profile remove <profile>
-
-<profile> is the full name of the profile.
-
-Profile Help
-
-Help displays usage descriptions for this command, or usage descriptions for
-sub-commands.
-
-Usage:
- profile help [flags] [command ...]
-
-[command ...] is an optional sequence of commands to display detailed usage.
-The special-case "help ..." recursively displays help for all commands.
-
-The help flags are:
- -style=text: The formatting style for help output, either "text" or "godoc".
-*/
package main
import (
diff --git a/tools/vrpc/doc.go b/tools/vrpc/doc.go
new file mode 100644
index 0000000..a2cb64e
--- /dev/null
+++ b/tools/vrpc/doc.go
@@ -0,0 +1,74 @@
+// This file was auto-generated via go generate.
+// DO NOT UPDATE MANUALLY
+
+/*
+The vrpc tool facilitates interaction with Veyron RPC servers. In particular,
+it can be used to 1) find out what API a Veyron RPC server exports and
+2) send requests to a Veyron RPC server.
+
+Usage:
+ vrpc <command>
+
+The vrpc commands are:
+ describe Describe the API of an Veyron RPC server
+ invoke Invoke a method of an Veyron RPC server
+ help Display help for commands or topics
+Run "vrpc help [command]" for command usage.
+
+The global flags are:
+ -alsologtostderr=true: log to standard error as well as files
+ -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
+ -log_dir=: if non-empty, write log files to this directory
+ -logtostderr=false: log to standard error instead of files
+ -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
+ -stderrthreshold=2: logs at or above this threshold go to stderr
+ -v=0: log level for V logs
+ -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
+ -vv=0: log level for V logs
+
+Vrpc Describe
+
+Describe connects to the Veyron RPC server identified by <server>, finds out what
+its API is, and outputs a succint summary of this API to the standard output.
+
+Usage:
+ vrpc describe <server>
+
+<server> identifies the Veyron RPC server. It can either be the object address of
+the server or an Object name in which case the vrpc will use Veyron's name
+resolution to match this name to an end-point.
+
+Vrpc Invoke
+
+Invoke connects to the Veyron RPC server identified by <server>, invokes the method
+identified by <method>, supplying the arguments identified by <args>, and outputs
+the results of the invocation to the standard output.
+
+Usage:
+ vrpc invoke <server> <method> <args>
+
+<server> identifies the Veyron RPC server. It can either be the object address of
+the server or an Object name in which case the vrpc will use Veyron's name
+resolution to match this name to an end-point.
+
+<method> identifies the name of the method to be invoked.
+
+<args> identifies the arguments of the method to be invoked. It should be a list
+of values in a VOM JSON format that can be reflected to the correct type
+using Go's reflection.
+
+Vrpc Help
+
+Help with no args displays the usage of the parent command.
+Help with args displays the usage of the specified sub-command or help topic.
+"help ..." recursively displays help for all commands and topics.
+
+Usage:
+ vrpc help [flags] [command/topic ...]
+
+[command/topic ...] optionally identifies a specific sub-command or help topic.
+
+The help flags are:
+ -style=text: The formatting style for help output, either "text" or "godoc".
+*/
+package main
diff --git a/tools/vrpc/main.go b/tools/vrpc/main.go
index 23c91af..46a30c8 100644
--- a/tools/vrpc/main.go
+++ b/tools/vrpc/main.go
@@ -1,74 +1,12 @@
-// Below is the output from $(vrpc help -style=godoc ...)
+// The following enables go generate to generate the doc.go file.
+// Things to look out for:
+// 1) go:generate evaluates double-quoted strings into a single argument.
+// 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'.
+// 3) We generate into a *.tmp file first, otherwise go run will pick up the
+// initially empty *.go file, and fail.
+//
+//go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go"
-/*
-The vrpc tool facilitates interaction with Veyron RPC servers. In particular,
-it can be used to 1) find out what API a Veyron RPC server exports and
-2) send requests to a Veyron RPC server.
-
-Usage:
- vrpc <command>
-
-The vrpc commands are:
- describe Describe the API of an Veyron RPC server
- invoke Invoke a method of an Veyron RPC server
- help Display help for commands
-
-The global flags are:
- -alsologtostderr=true: log to standard error as well as files
- -log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
- -log_dir=: if non-empty, write log files to this directory
- -logtostderr=false: log to standard error instead of files
- -max_stack_buf_size=4292608: max size in bytes of the buffer to use for logging stack traces
- -stderrthreshold=2: logs at or above this threshold go to stderr
- -v=0: log level for V logs
- -vmodule=: comma-separated list of pattern=N settings for file-filtered logging
- -vv=0: log level for V logs
-
-Vrpc Describe
-
-Describe connects to the Veyron RPC server identified by <server>, finds out what
-its API is, and outputs a succint summary of this API to the standard output.
-
-Usage:
- vrpc describe <server>
-
-<server> identifies the Veyron RPC server. It can either be the object address of
-the server or an Object name in which case the vrpc will use Veyron's name
-resolution to match this name to an end-point.
-
-Vrpc Invoke
-
-Invoke connects to the Veyron RPC server identified by <server>, invokes the method
-identified by <method>, supplying the arguments identified by <args>, and outputs
-the results of the invocation to the standard output.
-
-Usage:
- vrpc invoke <server> <method> <args>
-
-<server> identifies the Veyron RPC server. It can either be the object address of
-the server or an Object name in which case the vrpc will use Veyron's name
-resolution to match this name to an end-point.
-
-<method> identifies the name of the method to be invoked.
-
-<args> identifies the arguments of the method to be invoked. It should be a list
-of values in a VOM JSON format that can be reflected to the correct type
-using Go's reflection.
-
-Vrpc Help
-
-Help displays usage descriptions for this command, or usage descriptions for
-sub-commands.
-
-Usage:
- vrpc help [flags] [command ...]
-
-[command ...] is an optional sequence of commands to display detailed usage.
-The special-case "help ..." recursively displays help for all commands.
-
-The help flags are:
- -style=text: The formatting style for help output, either "text" or "godoc".
-*/
package main
import (