mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-24 04:57:00 +01:00
Fixes #306 adding command line autocompletion. These are generated to: CARGO_TARGET_DIR/item-hash/out/. These will need to be packaged for distros later, it's unclear how we could use cargo install with these as cargo doesn't support arbitrary artefacts like this (yet?).
22 lines
483 B
Rust
22 lines
483 B
Rust
#[macro_use]
|
|
extern crate serde_derive;
|
|
|
|
use std::env;
|
|
|
|
use std::path::PathBuf;
|
|
use structopt::clap::Shell;
|
|
use structopt::StructOpt;
|
|
|
|
include!("src/lib/audit_loglevel.rs");
|
|
include!("src/server/opt.rs");
|
|
|
|
fn main() {
|
|
let outdir = match env::var_os("OUT_DIR") {
|
|
None => return,
|
|
Some(outdir) => outdir,
|
|
};
|
|
|
|
KanidmdOpt::clap().gen_completions("kanidmd", Shell::Bash, outdir.clone());
|
|
KanidmdOpt::clap().gen_completions("kanidmd", Shell::Zsh, outdir);
|
|
}
|