forked from odilia-app/odilia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
44 lines (39 loc) · 1.2 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
use std::io;
//use clap::CommandFactory;
//use clap_complete::Shell;
//#[allow(dead_code)]
//#[path = "src/args.rs"]
//mod args;
fn main() -> io::Result<()> {
/*
// Commented out until we actually need shell completions
let out_dir = match env::var_os("OUT_DIR") {
Some(dir) => PathBuf::from(dir),
None => return Ok(()),
};
let mut completions_rs = File::create(out_dir.join("completions.rs"))?;
let shells: &[Shell] = &[
#[cfg(feature = "bash_completion")]
Shell::Bash,
#[cfg(feature = "elvish_completion")]
Shell::Elvish,
#[cfg(feature = "fish_completion")]
Shell::Fish,
#[cfg(feature = "powershell_completion")]
Shell::PowerShell,
#[cfg(feature = "zsh_completion")]
Shell::Zsh,
];
let mut cmd = args::Args::command();
for &shell in shells {
let path = clap_complete::generate_to(shell, &mut cmd, env!("CARGO_PKG_NAME"), &out_dir)?;
let shell_str = shell.to_string().to_uppercase();
writeln!(
completions_rs,
"pub const {}_COMPLETIONS: &'static str = include_str!({:?});",
shell_str, path
)?;
}
*/
Ok(())
}