subtitle-merge/build.rs

23 lines
536 B
Rust
Raw Permalink Normal View History

use std::{env, io};
use clap_complete::{generate_to, Shell};
use cli_args::Args;
use clap::{CommandFactory, ValueEnum};
mod cli_args {
include!("src/cli_args.rs");
}
fn main() -> io::Result<()> {
let Some(outdir) = env::var_os("OUT_DIR") else {
return Ok(());
};
let mut command = Args::command();
for shell in Shell::value_variants() {
generate_to(*shell, &mut command, "subtitle-merge", &outdir)?;
// println!("cargo:warning=completion file is generated: {path:?}");
}
Ok(())
}