pub fn generate_completions<T: CommandFactory>(shell: Shell)Expand description
Generate shell completion scripts for a clap-based CLI.
This function generates shell completions and prints both installation instructions
and the completion script to stdout. It supports bash, zsh, fish, elvish, and PowerShell.
§Type Parameters
T- A type that implementsCommandFactory(typically your clapClistruct)
§Arguments
shell- The shell type to generate completions for
§Examples
use clap::Parser;
use workhelix_cli_common::completions::generate_completions;
#[derive(Parser)]
struct Cli {
// your CLI definition
}
generate_completions::<Cli>(clap_complete::Shell::Bash);