-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.rs
37 lines (29 loc) · 1.03 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
#![allow(unused_mut)]
#![allow(unused_imports)]
#![allow(unused_variables)]
#[macro_use]
extern crate clap;
extern crate cli_setup;
use cli_setup::*;
use clap::Shell;
use clap::App;
pub const MAN_SN: &'static str = include_str!("man/tin-summer.1");
fn main() {
setup_thefuck();
setup_manpages(MAN_SN, "tin-summer");
// load configuration
#[cfg(feature = "english")]
let yaml = load_yaml!("src/cli/options-en.yml");
#[cfg(feature = "francais")]
let yaml = load_yaml!("src/cli/options-fr.yml");
#[cfg(feature = "deutsch")]
let yaml = load_yaml!("src/cli/options-de.yml");
let mut app = App::from_yaml(yaml).version(crate_version!());
// generate bash completions if desired
#[cfg(feature = "bash")]
app.gen_completions("sn", Shell::Bash, env!("BASH_COMPLETIONS_DIR"));
// generate fish completions if desired
let mut app_snd = App::from_yaml(yaml).version(crate_version!());
#[cfg(feature = "fish")]
app_snd.gen_completions("sn", Shell::Fish, env!("FISH_COMPLETIONS_DIR"));
}