jj / How jj util install-man-pages works

How jj util install-man-pages works

jj util install-man-pages writes a man page for every jj command into <PATH>/man1.

On this page
  1. 1. Command-line surface
  2. 3. End-to-end flow
  3. 4. Core architecture touchpoints

In short: it creates the man1 directory and lets the clap_mangen crate write one page per command from the clap command tree. It loads no repo. Packagers use it: the Nix build runs it and installs the result (source).

The command is cmd_util_install_man_pages. Its help text: "Install Jujutsu's manpages to the provided path" (source). It is the InstallManPages variant of UtilCommand (source, dispatch).

1. Command-line surface

ArgumentTypeDefaultMeaning
PATH (positional, required)pathnoneWhere the pages go, for example /usr/share/man; man1 is appended (source).

The global flags are on the CLI page.

3. End-to-end flow

jj util install-man-pages: flow cmd_util_install_man_pages joins man1 onto PATH and creates that directory with create_dir_all, then passes a clone of the clap command to clap_mangen::generate_to, which writes the pages there. PATH/man1 std::fs::create_dir_all clap_mangen::generate_to command.app().clone() → man1/

4. Core architecture touchpoints

PieceRole here
The clap command tree (command.app())The only input to the generator (source).
The file systemThe only thing written. The command prints nothing; upstream's test checks that man1 exists and is not empty afterwards (test).
Repo, working copy, operation logNot touched (source).