diff options
Diffstat (limited to 'pkgs/by-name/ts/tskm/build.rs')
-rw-r--r-- | pkgs/by-name/ts/tskm/build.rs | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/pkgs/by-name/ts/tskm/build.rs b/pkgs/by-name/ts/tskm/build.rs deleted file mode 100644 index e3b60bb9..00000000 --- a/pkgs/by-name/ts/tskm/build.rs +++ /dev/null @@ -1,52 +0,0 @@ -use anyhow::{Context, Result}; -use clap::{CommandFactory, ValueEnum}; -use clap_complete::generate_to; -use clap_complete::Shell; - -use std::env; -use std::fs; -use std::path::PathBuf; - -use crate::cli::CliArgs; - -pub mod task { - include!("src/task/mod.rs"); -} -pub mod state { - include!("src/state.rs"); -} - -pub mod interface { - pub mod input { - include!("src/interface/input/mod.rs"); - } - pub mod project { - include!("src/interface/project/mod.rs"); - } -} - -pub mod cli { - include!("src/cli.rs"); -} - -fn main() -> Result<()> { - let outdir = match env::var_os("SHELL_COMPLETION_DIR") { - None => return Ok(()), - Some(outdir) => outdir, - }; - - if !PathBuf::from(&outdir).exists() { - fs::create_dir_all(&outdir)?; - } - - let mut cmd = CliArgs::command(); - - for &shell in Shell::value_variants() { - let path = generate_to(shell, &mut cmd, "tskm", &outdir).with_context(|| { - format!("Failed to output shell completion for {shell} to {outdir:?}") - })?; - println!("cargo:warning=completion file for {shell} is generated at: {path:?}"); - } - - Ok(()) -} |