use std::{path::PathBuf, io::Error}; use clap_complete::{generate_to, shells, Generator}; include!("src/cli.rs"); fn main() -> Result<(), Error> { let outdir = "completions"; let mut cmd = build_cli(); let path = generate_completions(shells::Bash, &mut cmd, outdir)?; println!("cargo:debug=completion file is generated: {:?}", path); let path = generate_completions(shells::Zsh, &mut cmd, outdir)?; println!("cargo:debug=completion file is generated: {:?}", path); let path = generate_completions(shells::Fish, &mut cmd, outdir)?; println!("cargo:debug=completion file is generated: {:?}", path); Ok(()) } fn generate_completions(shell: G, cmd: &mut clap::Command, outdir: &str) -> Result { generate_to(shell, cmd, "lamp", outdir) }