summaryrefslogtreecommitdiffstats
path: root/sq/build.rs
blob: b7d3147d8a385f3d07e669a9ad1b8df613b91c98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use clap;

use std::env;
use std::fs;
use clap::Shell;

mod sq_cli {
    include!("src/sq_cli.rs");
}

fn main() {
    let outdir = match env::var_os("CARGO_TARGET_DIR") {
        None => return,
        Some(outdir) => outdir,
    };
    fs::create_dir_all(&outdir).unwrap();
    let mut sq = sq_cli::build();
    for shell in &[Shell::Bash, Shell::Fish, Shell::Zsh, Shell::PowerShell,
                   Shell::Elvish] {
        sq.gen_completions("sq", *shell, &outdir);
    }
}