Support for completions

This commit is contained in:
Jedsek
2022-08-22 19:31:12 +08:00
committed by andy.boot
parent 5980858b39
commit 81d52e6e3a
11 changed files with 476 additions and 155 deletions
+18
View File
@@ -0,0 +1,18 @@
use clap_complete::{generate_to, shells::*};
use std::io::Error;
include!("src/cli.rs");
fn main() -> Result<(), Error> {
let outdir = "completions";
let app_name = "dust";
let mut cmd = build_cli();
generate_to(Bash, &mut cmd, app_name, outdir)?;
generate_to(Zsh, &mut cmd, app_name, outdir)?;
generate_to(Fish, &mut cmd, app_name, outdir)?;
generate_to(PowerShell, &mut cmd, app_name, outdir)?;
generate_to(Elvish, &mut cmd, app_name, outdir)?;
Ok(())
}