feat: hidden hivectl markdown-docs subcommand emitting the cli reference as commonmark
This commit is contained in:
parent
d952e7ac01
commit
ad8a3a8cbf
3 changed files with 24 additions and 0 deletions
|
|
@ -90,6 +90,15 @@ enum Cmd {
|
|||
#[arg(long)]
|
||||
fresh: bool,
|
||||
},
|
||||
/// Emit the full CLI reference as `CommonMark` to stdout.
|
||||
///
|
||||
/// Hidden tooling command (not part of day-to-day operator admin):
|
||||
/// walks this binary's own clap command tree and renders every verb,
|
||||
/// flag, and help string as markdown. Used by the docs build to keep
|
||||
/// the published `hivectl` reference in lockstep with the code — no
|
||||
/// hand-maintained command list to drift out of date.
|
||||
#[command(hide = true)]
|
||||
MarkdownDocs,
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
|
|
@ -330,6 +339,10 @@ async fn main() -> Result<()> {
|
|||
AgentsCmd::RestartAll { socket } => agents_restart_all(&socket).await,
|
||||
},
|
||||
Cmd::Choom { name, fresh } => choom(&name, fresh),
|
||||
Cmd::MarkdownDocs => {
|
||||
print!("{}", clap_markdown::help_markdown::<Cli>());
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue