1 2 3 4 5 6 7 8 9 10 11 12
use clap::Command; use clap_complete::{Generator, generate}; use std::io; pub fn print_completions<G: Generator>(generator: G, cmd: &mut Command) { generate( generator, cmd, cmd.get_name().to_string(), &mut io::stdout(), ); }