mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-05-24 08:17:14 +02:00
update dependencies
This commit is contained in:
parent
dbccffc135
commit
7d57c0a8a8
4 changed files with 106 additions and 55 deletions
29
build.rs
29
build.rs
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue