Ship shell completions and a man page - #41
Merged
Merged
Conversation
The command line has grown to six flags, three of them with a fixed set of values, and none of it completed in a shell. There was no man page either, so `man pokeductor` found nothing on a system that installed it from a package. clap already held all of it — the values come from the enums and the help text is written on `Cli` — so both only had to be asked for. `--completions SHELL` prints the script for bash, zsh, fish, PowerShell or elvish, and a hidden `--man` prints the page as roff. They come out of the binary rather than a build script or an xtask, which is what #38 suggested to keep them out of the dependency tree. The cost of that turned out to be one crate, `roff`, and the xtask route would have left the AUR package with nothing to generate them from, since it builds from the crates.io tarball where an xtask does not exist. A flag works wherever the crate builds. Both are `exclusive`, as the other print-and-exit commands effectively are. Tests pin the part that could drift: every visible long flag appears in every shell's script and in the man page, and `--man` stays out of it. The release workflow generates them once, in a job of its own, and every archive carries `completions/` and `man/`. Once rather than per target because the text is the same everywhere, and because the Intel Mac build cross-compiles on an ARM runner and could not run its own binary to ask. The release job now downloads only the per-target artifacts, since the extras' directories under `dist/` would make `gh release create dist/*` fail. `print` moved to `cli.rs` so `--json` and the generators share the one place that ends quietly on a closed pipe. Closes #38
Huseynteymurzade28
force-pushed
the
completions
branch
from
September 24, 2026 13:09
529cd57 to
de7ace2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
--completions SHELL(bash, zsh, fish, PowerShell, elvish) and a hidden--man. Both are generated from theClidefinition withclap_completeandclap_mangen.roff, MIT/Apache, MSRV 1.85).extrasjob generates the files once, and every archive carriescompletions/andman/. The release job now downloads only the per-target artifacts, sogh release create dist/*doesn't hit the directories.-h. The changelog has an entry.Checked locally: fish completes flags and their values, and the man page renders under
groff -wwwith no warnings. A manual run of the release workflow on this branch checks the archive layout.Closes #38