diff options
author | Thayne McCombs <astrothayne@gmail.com> | 2022-06-17 02:08:24 -0600 |
---|---|---|
committer | Thayne McCombs <astrothayne@gmail.com> | 2022-10-08 00:41:33 -0600 |
commit | 4e7b403c1fea376f1b5be8cb25e10688a4b120f5 (patch) | |
tree | 78858c7e946a359997e80d10469320d7df4ae682 /build.rs | |
parent | 45d6f55d3aecdeb01ee2317423ae9459c771bca7 (diff) |
Use clap-derive for option parsing
This makes the definition of arguments to fd a little more ergonomic,
and makes it easier to insure the types for the arguments are consitent.
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 21 |
1 files changed, 0 insertions, 21 deletions
@@ -1,11 +1,3 @@ -use std::fs; - -use clap_complete::{generate_to, Shell}; -use Shell::*; -//use clap_complete::shells::Shel{Bash, Fish, PowerShell, Elvish}; - -include!("src/app.rs"); - fn main() { let min_version = "1.56"; @@ -17,17 +9,4 @@ fn main() { std::process::exit(1); } } - - let var = std::env::var_os("SHELL_COMPLETIONS_DIR").or_else(|| std::env::var_os("OUT_DIR")); - let outdir = match var { - None => return, - Some(outdir) => outdir, - }; - fs::create_dir_all(&outdir).unwrap(); - - let mut app = build_app(); - // NOTE: zsh completions are hand written in contrib/completion/_fd - for shell in [Bash, PowerShell, Fish, Elvish] { - generate_to(shell, &mut app, "fd", &outdir).unwrap(); - } } |