update dependencies

This commit is contained in:
crapStone 2022-07-15 23:34:09 +02:00
parent dbccffc135
commit 7d57c0a8a8
No known key found for this signature in database
GPG key ID: 4CAA9E39EEDEB1F0
4 changed files with 106 additions and 55 deletions

View file

@ -1,14 +1,23 @@
use clap::Shell;
use std::{path::PathBuf, io::Error};
use clap_complete::{generate_to, shells, Generator};
include!("src/cli.rs");
fn main() {
let outdir = "completions"; // match env::var_os("OUT_DIR") {
// None => return,
// Some(outdir) => outdir,
// };
let mut app = build_cli();
app.gen_completions("lamp", Shell::Fish, outdir);
// app.gen_completions("lamp", Shell::Zsh, outdir); // TODO search for bug
app.gen_completions("lamp", Shell::Bash, outdir);
fn main() -> Result<(), Error> {
let outdir = "completions";
let mut cmd = build_cli();
let path = generate_completions(shells::Bash, &mut cmd, outdir)?;
println!("cargo:debug=completion file is generated: {:?}", path);
let path = generate_completions(shells::Zsh, &mut cmd, outdir)?;
println!("cargo:debug=completion file is generated: {:?}", path);
let path = generate_completions(shells::Fish, &mut cmd, outdir)?;
println!("cargo:debug=completion file is generated: {:?}", path);
Ok(())
}
fn generate_completions<G: Generator>(shell: G, cmd: &mut clap::Command, outdir: &str) -> Result<PathBuf, Error> {
generate_to(shell, cmd, "lamp", outdir)
}