Repository navigation
v0.0.7
[0.0.7] - 2026-04-27
bunpy --help is no longer the only thing that prints help.
This rung adds bunpy help <cmd> (long-form help inline) and
bunpy man <cmd> (the bundled roff manpage). Both surfaces
ship as bytes embedded in the binary, so no network or
filesystem lookup is required to read them.
A single source of truth keeps the two help routes honest. The
helpRegistry map in cmd/bunpy/help.go holds one entry per
subcommand; both bunpy help <cmd> and bunpy <cmd> --help
print the same body. CI asserts byte equality across every
wired command on every push, so the two surfaces cannot drift.
The manpages are a separate artefact. They live under
internal/manpages/man1/ as roff and are embedded via
//go:embed. The new internal/manpages Go package exposes
Page(name) and List(); bunpy man <cmd> shells through
Page, and bunpy man --install [dir] walks the embedded FS
and copies each page into <dir>/man1/. The release archives
now ship pre-rendered pages under share/man/man1/*.1, picked
up by install.sh and the Homebrew formula automatically.
Added
cmd/bunpy/help.go:helpRegistry,helpSubcommand,
printHelp,helpTopics. Five entries cover the wired
surface:run,stdlib,version,help,man.cmd/bunpy/manpages.go:bunpy man <cmd>prints the embedded
roff to stdout;bunpy man --install [dir]writes all pages
into<dir>/man1/. Default dir is$HOME/.bunpy/share/man.internal/manpages/: tiny Go package whose only job is to
host//go:embed man1/*.1. ExportsFS(),Page(name),
List(), plus theRootconstant.internal/manpages/man1/*.1: six roff manpages (bunpy.1,
bunpy-run.1, bunpy-stdlib.1, bunpy-version.1, bunpy-help.1,
bunpy-man.1). All start with a.THheader.- Tests:
internal/manpages/manpages_test.gocovers the embed
load, the.THprefix on every page, and a missing-page
error.cmd/bunpy/main_test.goadds parity tests for
bunpy help <cmd>vsbunpy <cmd> --help, the unknown-help
error path, and thebunpy man --installround-trip.
Changed
cmd/bunpy/main.go: dispatch growshelpandmancases.
--helpbranches inrun,stdlib,version, andman
all route throughprintHelp(name, ...). The top-level
usage()iterateshelpTopics()so the command list stays
in sync with the registry.install.sh: after the binary is in place, the script runs
bunpy man --install $INSTALL_DIR/share/manand prints a
MANPATHhint alongside the existingPATHhint.scripts/formula.rb.tmpl: the Homebrew install block now
picks upshare/man/man1/*.1from the staged archive when
present. Existing installs upgrade without manual steps..github/workflows/release.yml: each matrix leg builds a
host binary and runsbunpy man --installagainst the
staged archive so the linux and darwin tarballs ship
rendered manpages. Windows archives skip this..github/workflows/ci.yml: smoke job now asserts
bunpy help <cmd>matchesbunpy <cmd> --helpbyte-for-byte
for every wired command, printsbunpy man runand checks
for the.THheader, and round-tripsbunpy man --install
into a tempdir.docs/CLI.md: Meta section grows thehelpandman
entries; the synopsis preamble updates the wired surface
list.docs/INSTALL.md: documentsMANPATHsetup and the manual
manpage install path.docs/ARCHITECTURE.md: new "Help and manpages" section, and
internal/manpages/lands in the module layout block.docs/ROADMAP.md: v0.0.7 marked shipped, v0.0.8 (bunpy repl) next.
Notes
- Manpages are not generated for Windows archives; the
release workflow gates onmatrix.goos != 'windows'. - The release archives are still backwards-compatible: older
consumers that ignoreshare/man/keep working unchanged.