Conversation
- add doc/generate_commands.py, which parses the Command constructors - add doc/sphinx/commands.rst and the missing bounds/taxscreen man pages - regenerate the other man pages, which had drifted since 2019 - read the docs version from version.h and add make docs/check-docs
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.
Problem
There is no command reference in the documentation. mash.readthedocs.io explains concepts but never lists the subcommands or their options. The man pages do, but they were generated in 2019 and have drifted:
mash-sketch.1is missing-I,-C,-Sand-M, andboundsandtaxscreenare documented nowhere at all.conf.pyalso still reported version 2.0.The cause is that option definitions live in C++ and were copied by hand into two other places, both of which fell behind.
Approach
doc/generate_commands.pyparses theaddOption/useOptioncalls in theCommandsubclass constructors and renders both outputs from that one source:doc/sphinx/commands.rst— new reference page, added to the toctreedoc/man/mash*.1— regenerated, plus newmash-bounds.1andmash-taxscreen.1It mirrors
Command::print(), so the output matchesmash <command> -hexactly.This does not reintroduce asciidoctor. 7ccc985 removed that dependency deliberately, and the generated files stay committed, so building and installing still need no extra tools. The script only runs when a developer changes an option:
make docsregenerates,make check-docsfails if the files are stale.Verification
Checked against a binary built from this tree: all 84 options across the 8 commands match
mash <command> -hexactly, in both outputs. Sphinx builds clean on 8.2.3 (what readthedocs uses) and 9.1.0; all 9 man pages passgroff -ww; the generator is idempotent.11 of the 15 files are generated — only the script and four small edits are hand-written. Reviewers can confirm with
python3 doc/generate_commands.py --check.Note