git_helpe_rs/autocompletion.rs
1use anyhow::Result;
2use clap_complete::{generate_to, shells::Bash};
3use std::path::PathBuf;
4
5use crate::cli::define::build_cli_commands;
6
7pub fn generate(path: PathBuf) -> Result<()> {
8 let mut cmd = build_cli_commands();
9 let path = generate_to(Bash, &mut cmd, "git-helpe-rs", path)?;
10
11 println!("completion file has been generated into: {path:?}");
12
13 Ok(())
14}