Documentation
¶
Overview ¶
Command gen-docs writes upgradescope's shell completions and man pages, rendered from the same cobra command tree the binary runs, so they cannot drift from its flags. GoReleaser's before hook runs it; the release archives, deb/rpm/apk packages and the Homebrew formula ship the result:
<out>/completions/upgradescope.{bash,zsh,fish,ps1}
<out>/manpages/upgradescope[-<command>...].1.gz
Unlike the other tools/ programs it is part of the main module: it imports internal/cli. It is a separate program rather than a hidden subcommand so the shipped binary does not link the man page renderer.
The man page date is -date (RFC 3339; GoReleaser passes the commit date), else $SOURCE_DATE_EPOCH, else now. Output is byte-for-byte reproducible for a given date: cobra's auto-generated tag is off and the gzip headers carry no timestamp.
go run ./tools/gen-docs -out packaging/generated -date 2026-10-01T12:00:00Z
With -reference it writes the docs site's generated references instead (reference.go): the CLI pages, the ClusterReadiness CRD and the REST API rendered from api/openapi.yaml. They carry no date, so the committed copies can be checked for drift (TestReferenceIsFresh, make docs-check):
go run ./tools/gen-docs -reference docs/reference