Documentation ¶
Overview ¶
Usage of gendoc:
-build-cmd string Comand to use for building/installing commands whose usage is to be documented, it must accept the same flags as 'go install'. -copyright-notice string File containing the copyright notice to be prepended to the autogenerated documentation; if specified as an empty string then no copyright notice will be used. -env string Environment variables to set before running command. If "os", grabs vars from the underlying OS. If empty, doesn't set any vars. Otherwise vars are expected to be comma-separated entries of the form KEY1=VALUE1,KEY2=VALUE2,... (default "os") -go-flag-pkg Set if the command is using the standard go flag package, it sets both use-stderr and postprocess-output to true -install string Comma separated list of packages to install before running command. All commands that are built will be on the PATH. -out string Path to the output file. (default "./doc.go") -postprocess-output If set, the help/usage output will be post processed to remove absolute path names that contain the build directory. -tags string Tags for go build, also added as build constraints in the generated output file. -use-stderr If set, read usage output from stderr rather than stdout; it also ignores the exit status of the command.
Command gendoc generates godoc comments describing the usage of tools based on the cmdline package.
Usage:
go run gendoc.go [flags] <pkg> [args]
<pkg> is the package path for the tool.
[args] are the arguments to pass to the tool to produce usage output. If no args are given, runs "<tool> help ..."
The gendoc command itself is not based on the cmdline library to avoid non-trivial bootstrapping.
Click to show internal directories.
Click to hide internal directories.