Summary
optiqor has no man page. Cobra ships a doc package (github.com/spf13/cobra/doc) that can generate a complete man page tree from any Cobra command tree. Packaging man pages in releases is a low-effort, high-signal quality indicator for CLI tools.
What to do
- Add a build-time generator script
cmd/gendoc/main.go (not part of the main binary):
//go:build ignore
package main
import (
"github.com/spf13/cobra/doc"
optiqor "github.com/optiqor/optiqor-cli/cmd/optiqor"
)
func main() {
doc.GenManTree(optiqor.RootCmd, &doc.GenManHeader{
Title: "OPTIQOR",
Section: "1",
}, "./man")
}
This requires exporting RootCmd from cmd/optiqor/main.go (currently unexported as rootCmd).
- Add a
make man target that runs go run cmd/gendoc/main.go and writes to man/.
- Update
.goreleaser.yaml to include man/*.1 files in the Linux archives.
Acceptance criteria
make man generates man/optiqor.1 (and sub-pages for each subcommand).
man ./man/optiqor.1 renders without errors.
- Man files are included in the GoReleaser Linux archive.
make lint test passes.
Why this is a good first issue
- No new runtime dependencies (cobra/doc is already transitively available).
- Self-contained:
cmd/gendoc/main.go is a separate binary, so there is zero risk of touching the main binary.
References
Summary
optiqorhas no man page. Cobra ships adocpackage (github.com/spf13/cobra/doc) that can generate a complete man page tree from any Cobra command tree. Packaging man pages in releases is a low-effort, high-signal quality indicator for CLI tools.What to do
cmd/gendoc/main.go(not part of the main binary):RootCmdfromcmd/optiqor/main.go(currently unexported asrootCmd).make mantarget that runsgo run cmd/gendoc/main.goand writes toman/..goreleaser.yamlto includeman/*.1files in the Linux archives.Acceptance criteria
make mangeneratesman/optiqor.1(and sub-pages for each subcommand).man ./man/optiqor.1renders without errors.make lint testpasses.Why this is a good first issue
cmd/gendoc/main.gois a separate binary, so there is zero risk of touching the main binary.References