Skip to content

Add man page output for the frontends#1004

Merged
mnadareski merged 6 commits into
SabreTools:masterfrom
gmipf:pr/6-manpage-generation
Jul 17, 2026
Merged

Add man page output for the frontends#1004
mnadareski merged 6 commits into
SabreTools:masterfrom
gmipf:pr/6-manpage-generation

Conversation

@gmipf

@gmipf gmipf commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

MPF.CLI man and MPF.Check man write a roff man page to standard output, rendered from the same command model that produces --help. Packagers currently hand-write these pages and re-sync them on every release; this removes that drift at the source.

This wires up the man page feature added to SabreTools.CommandLine (SabreTools/SabreTools.CommandLine#2). That release is out — 1.5.0 on nuget.org — and master already references it, so the draft note about the pin no longer applies and this is ready for review.

What it does

  • MPF.CLI man and MPF.Check man render a page from the existing feature/input model. No new plumbing: man is just another reference feature, like Help.
  • The graphical frontend has no command-line model to render from, so a short hand-maintained page (MPF.Avalonia/MPF.1) is included for it.

A packager then does:

MPF.CLI man > MPF.CLI.1      # generate roff from the binary
# stamp the .TH date at build time
# install into the man path

Two intentional details:

  • The page is emitted before the configuration path and other startup output, so the redirect above yields clean roff with no leading Configuration path: line. Generating it has no side effects: it never writes config.json and never runs first-run setup.
  • The .TH date is left blank so a distributor stamps it at build time, keeping output reproducible. This is the only thing mandoc -T lint flags until it is stamped.

Installing the pages is left to distributors; this PR only adds the ability to produce them.

Verification

Against the published SabreTools.CommandLine 1.5.0, on this branch with master merged in:

  • The full solution builds clean across every target framework with TreatWarningsAsErrors, 0 warnings.
  • Both pages generate with exit code 0 and empty standard error, from a runtime directory with no config.json — and none is created, neither there nor under ~/.config/mpf.
  • groff -man -ww -z reports no warnings for all three pages. mandoc -T lint is clean except the intended missing-date warning.
  • The generated page picks up features added upstream since this branch was opened (listpath, for one) with no change here, which is the point of generating rather than hand-writing it.

Choices made

Names in .TH/NAME follow the assembly names (MPF.CLI, MPF.Check, MPF), matching what is invoked; the GUI page sits next to its project; option descriptions use the verbose form so the page is self-contained. Each is a one-line change if you would rather have it otherwise.


Prepared with AI assistance (Claude Opus 4.8) and reviewed before submission.

gmipf and others added 2 commits July 1, 2026 20:42
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>
@gmipf
gmipf marked this pull request as ready for review July 13, 2026 11:59
@gmipf

gmipf commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

SabreTools.CommandLine 1.5.0 is on nuget.org and master already references it, so the blocker for this draft is gone. Merged master in and marked this ready for review — no rebase, so your earlier view of the diff still lines up.

Verified against the published 1.5.0: the full target-framework sweep builds clean with no warnings, both pages generate with no side effects (no config.json written, in the runtime directory or under ~/.config/mpf), and groff -man -ww -z is silent on all three pages. The generated page also picked up listpath, which was added upstream after this branch was opened — without a change here, which is the whole point of rendering it from the command model.

I dropped the open questions from the description and made the calls, so there is nothing to decide before merging; each is a one-line change if you want it different.

Generated with Claude Opus 4.8.

Comment thread MPF.CLI/Program.cs
Comment thread MPF.Avalonia/MPF.1
@gmipf

gmipf commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Merged master in (twice — it moved while I was working), no rebase, so your view of the diff still lines up. Only CHANGELIST.md conflicted; your entries keep their order and mine sit at the bottom of the WIP list.

Your Add logical opposite flags to Check from today is a good demonstration of why the page is rendered from the command model rather than maintained by hand: all six new flags — --no-archives, --no-artifacts, --no-create-ird, --no-debug-protection, --no-delete, --no-placeholders — are in the generated page without a single change on this branch. The MPF.Check page now documents 42 options, the MPF.CLI page 17.

Re-verified after the merge, on a machine with no configuration: both pages generate clean (MPF.CLI 1907 bytes, MPF.Check 3297 bytes, both starting at the roff comment), groff -man -ww -z is silent on both, and no config.json is written anywhere.

Generated with Claude Opus 4.8.

@mnadareski
mnadareski merged commit d4b7646 into SabreTools:master Jul 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants