Ship a man page and shell completions #8
Labels
No labels
bug
design
docs
enhancement
good-first-issue
packaging
rendering
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/spoor#8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Generate a man page (
clap_mangen) and shell completions (clap_complete) at build time, andinstall them from the Nix package.
Why
Principle 4 makes the key binding the whole configuration, which means every piece of
configuration is a CLI flag and
--helpis the only reference there is. A tool with that shapeshould ship
spoor(1), and a config-less tool is exactly the one whose flags you want completedat the prompt rather than looked up.
The doc comments on
Cliinsrc/main.rsare already written as reference prose (the longlong_aboutabout logical sources, the per-flag rationale), so a man page is close to free.Sketch
build.rsor a smallxtask/--generatepath emittingspoor.1and the bash/zsh/fishcompletions from the same
clapcommand.flake.nixinstalls them into$out/share/man/man1and the usual completion directories, sonix profile installgets them without extra steps.