summaryrefslogtreecommitdiffstats
path: root/tool/build.rs
blob: 2dc5371d8d163057849210b6c2c4ae67da5eba01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
extern crate clap;

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

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

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

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