Add man page output for the frontends#1004
Draft
gmipf wants to merge 1 commit into
Draft
Conversation
Register the man page reference feature from SabreTools.CommandLine in MPF.CLI and MPF.Check so that "MPF.CLI man" and "MPF.Check man" write a roff man page built from the same command model as the help output. The page is emitted before any configuration handling so the roff stays clean for redirection to a file. Add a hand-maintained man page for the graphical frontend, which has no command-line model to generate from. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
This wires up the man page reference feature added to
SabreTools.CommandLine(#2) so the frontends can produce their own man pages, instead of packagers
hand-writing and re-syncing them.
What it does
MPF.CLI manandMPF.Check manwrite a roff man page to standard output,rendered from the same command model that produces
--help.hand-maintained page (
MPF.Avalonia/MPF.1) is included for it.How a man page is produced
The
manfeature is just another reference feature (likeHelp), so no newplumbing: each program registers
new Manpage(...)with its name/descriptionand the library renders the page from the existing feature/input model.
A packager (or anyone) then does:
Two intentional details:
output, so the redirect above yields clean roff with no leading
Configuration path:line. Generating it has no side effects: it never writesconfig.jsonor runs first-run setup, and the content is drawn only from thestatic command model, so the output is identical whether or not a config
exists.
.THdate is left blank so a distributor stamps it at build time,keeping output reproducible (the library documents this). This is the only
thing
mandoc -T lintflags until it's stamped.Installing the pages is left to distributors; this PR only adds the ability to
produce them.
Verification
TreatWarningsAsErrors(spot-checked net20 and net10.0;full TFM sweep before merge).
groff -man -ww -zwith no warningsand
mandoc -T lintclean except the intended "missing date" warning.Open questions
.TH/NAMEuse the assembly names (MPF.CLI,MPF.Check,MPF).Happy to switch to lowercase (
mpf-cli, ...) if you prefer.MPF.Avalonia/MPF.1; I can move it to aman/folder.includeVerbose: true). Easy todrop to the short form if you'd rather keep the page terse.
Prepared with AI assistance (Claude Opus 4.8) and reviewed before submission.