1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! `mk gen-man` — self-emit roff man pages from the compiled clap `Command`
//! tree.
//!
//! Writes one `*.1` page per (nested) subcommand into `--out <DIR>` via
//! `clap_mangen::generate_to`. The pages are clap-generated, hence
//! **binary-faithful by construction** — there is no content-fidelity gate
//! (the page cannot drift from the binary's actual flag surface).
//!
//! ## Mechanism (SPEC §2 / C-1)
//!
//! The call is the bare, naive form — `clap_mangen::generate_to(Cli::command(),
//! &dir)` with **NO pre-`.build()`**. Under clap_mangen 0.3 + clap 4.6.1 a
//! pre-`.build()` POISONS the output with a `help` pseudo-subcommand SHADOW
//! TREE (spurious `*-help*.1` pages). `generate_to` internally does
//! `disable_help_subcommand(true)` THEN `cmd.build()`; an external `root.build()`
//! run FIRST materializes the `help` subcommands before the internal disable
//! can suppress them. The naive call is clean.
use PathBuf;
use CommandFactory;
use crateResult;
/// `mk gen-man` arguments.
/// Run `mk gen-man`.