-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.rs
36 lines (30 loc) · 1.04 KB
/
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
// Storage daemon (stored): microservice frontend for different storage backends
// used in LNP/BP nodes.
//
// Written in 2022 by
// Dr. Maxim Orlovsky <[email protected]>
//
// Copyright (C) 2022 by LNP/BP Standards Association, Switzerland.
//
// You should have received a copy of the MIT License along with this software.
// If not, see <https://opensource.org/licenses/MIT>.
use std::{env, fs};
use clap::IntoApp;
use clap_complete::generate_to;
use clap_complete::shells::*;
pub mod stored {
include!("src/opts.rs");
}
fn main() -> Result<(), configure_me_codegen::Error> {
if env::var("DOCS_RS").is_err() {
let outdir = "./shell";
fs::create_dir_all(outdir).expect("failed to create shell dir");
let mut app = stored::Opts::command();
let name = app.get_name().to_string();
generate_to(Bash, &mut app, &name, outdir)?;
generate_to(PowerShell, &mut app, &name, outdir)?;
generate_to(Zsh, &mut app, &name, outdir)?;
// configure_me_codegen::build_script_auto()
}
Ok(())
}