forked from mycitadel/mycitadel-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
51 lines (44 loc) · 1.3 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// MyCitadel: node, wallet library & command-line tool
// Written in 2021 by
// Dr. Maxim Orlovsky <[email protected]>
//
// To the extent possible under law, the author(s) have dedicated all
// copyright and related and neighboring rights to this software to
// the public domain worldwide. This software is distributed without
// any warranty.
//
// You should have received a copy of the AGPL License
// along with this software.
// If not, see <https://www.gnu.org/licenses/agpl-3.0-standalone.html>.
#[macro_use]
extern crate amplify;
use clap::IntoApp;
use clap_generate::{generate_to, generators::*};
pub mod shared {
include!("src/shared.rs");
}
pub mod cli {
include!("src/cli/opts.rs");
}
pub mod daemon {
include!("src/daemon.rs");
}
pub mod embedded {
include!("src/embedded.rs");
}
fn main() -> Result<(), configure_me_codegen::Error> {
let outdir = "./shell";
for app in [
daemon::Opts::into_app(),
cli::Opts::into_app(),
embedded::Opts::into_app(),
]
.iter_mut()
{
let name = app.get_name().to_string();
generate_to::<Bash, _, _>(app, &name, &outdir)?;
generate_to::<PowerShell, _, _>(app, &name, &outdir)?;
generate_to::<Zsh, _, _>(app, &name, &outdir)?;
}
configure_me_codegen::build_script_auto()
}