-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
39 lines (29 loc) · 897 Bytes
/
build.rs
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
27
28
29
30
31
32
33
34
35
36
37
38
39
#![allow(unused)]
extern crate clap;
extern crate log;
use std::ffi::OsString;
use std::fs::File;
use std::io::Read;
use std::path::Path;
use clap::CommandFactory;
use clap_complete::{generate_to, Generator, Shell};
include!("src/args.rs");
fn generate_completions<G, P>(shell: G, dir: P) -> anyhow::Result<()>
where
G: Generator,
P: Into<OsString>,
{
let mut command = Args::command();
// uncomment to generate completions,
// commented because it slows down builds for testing
generate_to(shell, &mut command, "packwizml", dir)?;
Ok(())
}
fn main() -> anyhow::Result<()> {
// generate_completions(Shell::PowerShell, "completions")?;
// generate_completions(Shell::Bash, "completions")?;
// generate_completions(Shell::Zsh, "completions")?;
// generate_completions(Shell::Fish, "completions")?;
dotenv_build::output(dotenv_build::Config::default())?;
Ok(())
}