mirror of
https://github.com/SinTan1729/movie-rename.git
synced 2024-12-25 19:58:36 -06:00
21 lines
603 B
Rust
21 lines
603 B
Rust
use clap_complete::generate_to;
|
|
use clap_complete::shells::{Bash, Fish, Zsh};
|
|
use std::env;
|
|
use std::ffi::OsString;
|
|
use std::fs::{create_dir, remove_dir_all};
|
|
use std::io::Error;
|
|
|
|
include!("src/args.rs");
|
|
|
|
fn main() -> Result<(), Error> {
|
|
let target = "./target/autocomplete";
|
|
remove_dir_all(target).ok();
|
|
create_dir(target)?;
|
|
let outdir = OsString::from(target);
|
|
|
|
let mut cmd = get_command();
|
|
generate_to(Bash, &mut cmd, "movie-rename", &outdir)?;
|
|
generate_to(Fish, &mut cmd, "movie-rename", &outdir)?;
|
|
generate_to(Zsh, &mut cmd, "movie-rename", &outdir)?;
|
|
Ok(())
|
|
}
|