Skip to content

v0.0.7

Choose a tag to compare

@github-actions github-actions released this 27 Apr 05:35
· 144 commits to main since this release
v0.0.7
f35c332

[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. Exports FS(), Page(name),
    List(), plus the Root constant.
  • 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 .TH header.
  • Tests: internal/manpages/manpages_test.go covers the embed
    load, the .TH prefix on every page, and a missing-page
    error. cmd/bunpy/main_test.go adds parity tests for
    bunpy help <cmd> vs bunpy <cmd> --help, the unknown-help
    error path, and the bunpy man --install round-trip.

Changed

  • cmd/bunpy/main.go: dispatch grows help and man cases.
    --help branches in run, stdlib, version, and man
    all route through printHelp(name, ...). The top-level
    usage() iterates helpTopics() 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/man and prints a
    MANPATH hint alongside the existing PATH hint.
  • scripts/formula.rb.tmpl: the Homebrew install block now
    picks up share/man/man1/*.1 from the staged archive when
    present. Existing installs upgrade without manual steps.
  • .github/workflows/release.yml: each matrix leg builds a
    host binary and runs bunpy man --install against 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> matches bunpy <cmd> --help byte-for-byte
    for every wired command, prints bunpy man run and checks
    for the .TH header, and round-trips bunpy man --install
    into a tempdir.
  • docs/CLI.md: Meta section grows the help and man
    entries; the synopsis preamble updates the wired surface
    list.
  • docs/INSTALL.md: documents MANPATH setup 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 on matrix.goos != 'windows'.
  • The release archives are still backwards-compatible: older
    consumers that ignore share/man/ keep working unchanged.