Add shell completions and a man page #63

Merged
jcoffey-dev merged 1 commits from feat/completions into main 2026-11-13 16:20:46 +00:00
Owner

Adds inbuxa completions and inbuxa man — the installer's half of the completions + man-page parity that cli (#12) and migrate (#74) already have. It was the only one of the three tools without them.## What it does- inbuxa completions bash|zsh|fish writes a shell completion script.- inbuxa man writes the manual page in roff (inbuxa man > inbuxa.1).The installer is a single static binary (no release tarball), so rather than shipping separate script/man files it emits its own — the idiomatic Go approach, and always in step with the binary you have. README gains a short install section.## One source of truthBoth are generated from one command model that mirrors each command and its flags. A guard test (TestModelMatchesSwitch) parses the real top-level switch os.Args[1] in main() and fails if a command is added without a model entry, or the reverse — so completions and the man page can't silently drift from the dispatch.## Completion coverageCommands · each command's flags · the relay (install/status/uninstall) and cluster (doctor/join) subcommands and their flags · and flag-value completion for the fixed-set flags (--server/--console/--webmail → skip/container/host, --proxy → caddy/snippets/none) and file flags.## Validation- bash: bash -n clean; functionally exercised (sourced the script, drove _inbuxa through top-level, flag-prefix, value-after-flag, subcommand, and completions-argument cases — all return the right candidates).- zsh: zsh -n clean (descriptions single-quoted with each embedded apostrophe escaped, so a word like "machine's" does not end the quote).- fish: fish -c source loads clean.- man: groff -man -z -ww emits no warnings; renders correctly including the nested relay/cluster sub-lists.- gofmt clean · go vet + go build on amd64 and arm64 · go test ./... green (new completions_test.go + man_test.go) · stdlib-only (fmt/os/strings/time, regexp in tests — no new deps).No release-workflow change: the binary self-generates these, so there is nothing new to attach.

Adds `inbuxa completions` and `inbuxa man` — the installer's half of the completions + man-page parity that cli (#12) and migrate (#74) already have. It was the only one of the three tools without them.## What it does- `inbuxa completions bash|zsh|fish` writes a shell completion script.- `inbuxa man` writes the manual page in roff (`inbuxa man > inbuxa.1`).The installer is a **single static binary** (no release tarball), so rather than shipping separate script/man files it emits its own — the idiomatic Go approach, and always in step with the binary you have. README gains a short install section.## One source of truthBoth are generated from one `command` model that mirrors each command and its flags. A guard test (`TestModelMatchesSwitch`) parses the **real top-level `switch os.Args[1]`** in `main()` and fails if a command is added without a model entry, or the reverse — so completions and the man page can't silently drift from the dispatch.## Completion coverageCommands · each command's flags · the `relay` (install/status/uninstall) and `cluster` (doctor/join) subcommands and their flags · and **flag-value** completion for the fixed-set flags (`--server`/`--console`/`--webmail` → skip/container/host, `--proxy` → caddy/snippets/none) and file flags.## Validation- **bash**: `bash -n` clean; functionally exercised (sourced the script, drove `_inbuxa` through top-level, flag-prefix, value-after-flag, subcommand, and `completions`-argument cases — all return the right candidates).- **zsh**: `zsh -n` clean (descriptions single-quoted with each embedded apostrophe escaped, so a word like "machine's" does not end the quote).- **fish**: `fish -c source` loads clean.- **man**: `groff -man -z -ww` emits no warnings; renders correctly including the nested relay/cluster sub-lists.- gofmt clean · `go vet` + `go build` on amd64 and arm64 · `go test ./...` green (new `completions_test.go` + `man_test.go`) · **stdlib-only** (fmt/os/strings/time, regexp in tests — no new deps).No release-workflow change: the binary self-generates these, so there is nothing new to attach.
jcoffey-dev added 1 commit 2026-11-13 15:58:35 +00:00
Add shell completions and a man page
ci / test (pull_request) Successful in 35s
cfc2281045
inbuxa completions bash|zsh|fish writes a completion script, and inbuxa
man writes the manual page in roff. Both are generated from one command
model that mirrors the commands and their flags, so they stay in step
with the binary -- a single static binary writes its own rather than
shipping separate files.

The completions complete the commands, each command's flags, the relay
and cluster subcommands, and the values of the flags that take a fixed
set (--server/--console/--webmail, --proxy) or a file. A test parses the
real top-level switch in main() and fails if a command is added without
a model entry, or the reverse, so the two cannot drift apart.

This is the installer's half of the cross-cutting completions-and-man
parity the cli and migrate already have.
jcoffey-dev merged commit c245f318ed into main 2026-11-13 16:20:46 +00:00
jcoffey-dev deleted branch feat/completions 2026-11-13 16:20:46 +00:00
Sign in to join this conversation.