split hivectl main.rs into per-domain modules (#2509)
This commit is contained in:
parent
673aea4e50
commit
fc7720572b
16 changed files with 1922 additions and 1771 deletions
14
hivectl/src/completions.rs
Normal file
14
hivectl/src/completions.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
//! `hivectl completions <shell>` — emit a shell completion script,
|
||||
//! generated from the live clap command tree so it never drifts from the
|
||||
//! actual verbs and flags.
|
||||
|
||||
use crate::cli::Cli;
|
||||
|
||||
/// Emit a shell completion script for `hivectl` to stdout. Walks the clap
|
||||
/// command tree (the single source of truth — same tree `markdown-docs`
|
||||
/// renders) so completions never drift from the actual verbs/flags.
|
||||
pub(crate) fn generate_completions(shell: clap_complete::Shell) {
|
||||
use clap::CommandFactory as _;
|
||||
let mut cmd = Cli::command();
|
||||
clap_complete::generate(shell, &mut cmd, "hivectl", &mut std::io::stdout());
|
||||
}
|
||||
Loading…
Reference in a new issue