fd/build.rs

21 lines
520 B
Rust
Raw Normal View History

2017-10-04 14:31:08 +02:00
#[macro_use]
extern crate clap;
use clap::Shell;
include!("src/app.rs");
fn main() {
let var = std::env::var_os("SHELL_COMPLETIONS_DIR").or(std::env::var_os("OUT_DIR"));
let outdir = match var {
2017-10-04 14:31:08 +02:00
None => return,
Some(outdir) => outdir,
};
let mut app = build_app();
app.gen_completions("fd", Shell::Bash, &outdir);
app.gen_completions("fd", Shell::Fish, &outdir);
app.gen_completions("fd", Shell::Zsh, &outdir);
app.gen_completions("fd", Shell::PowerShell, &outdir);
2017-10-04 23:38:01 +02:00
}