From 1161da69ef35fcf69db95d2f1d6a81fce513d704 Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" <2071575+adamcstephens@users.noreply.github.com> Date: Tue, 3 Sep 2024 19:50:59 -0400 Subject: [PATCH] generate completions for elvish and fish (#3015) --- CONTRIBUTORS.md | 1 + server/daemon/build.rs | 23 ++++++---------- tools/cli/build.rs | 2 +- unix_integration/resolver/build.rs | 44 +++++++++++------------------- 4 files changed, 27 insertions(+), 43 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 36156f1ea..f43d8033f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -41,6 +41,7 @@ - Anton Loukianov (antonl) - fossdd - Wei Jian Gan (weijiangan) +- adamcstephens ## Acknowledgements diff --git a/server/daemon/build.rs b/server/daemon/build.rs index 5688d44f1..d32a5b0e7 100644 --- a/server/daemon/build.rs +++ b/server/daemon/build.rs @@ -31,18 +31,13 @@ fn main() { std::fs::create_dir(&comp_dir).expect("Unable to create completions dir"); } - generate_to( - Shell::Bash, - &mut KanidmdParser::command(), - "kanidmd", - comp_dir.clone(), - ) - .ok(); - generate_to( - Shell::Zsh, - &mut KanidmdParser::command(), - "kanidmd", - comp_dir, - ) - .ok(); + for shell in [Shell::Bash, Shell::Elvish, Shell::Fish, Shell::Zsh] { + generate_to( + shell, + &mut KanidmdParser::command(), + "kanidmd", + comp_dir.clone(), + ) + .ok(); + } } diff --git a/tools/cli/build.rs b/tools/cli/build.rs index 8be557e17..180f10c3c 100644 --- a/tools/cli/build.rs +++ b/tools/cli/build.rs @@ -34,7 +34,7 @@ fn main() -> Result<(), Error> { std::fs::create_dir(&comp_dir).expect("Unable to create completions dir"); } - for shell in [Shell::Bash, Shell::Zsh] { + for shell in [Shell::Bash, Shell::Elvish, Shell::Fish, Shell::Zsh] { generate_to( shell, &mut SshAuthorizedOpt::command(), diff --git a/unix_integration/resolver/build.rs b/unix_integration/resolver/build.rs index 08d8aae13..ef664a84c 100644 --- a/unix_integration/resolver/build.rs +++ b/unix_integration/resolver/build.rs @@ -30,33 +30,21 @@ fn main() { std::fs::create_dir(&comp_dir).expect("Unable to create completions dir"); } - generate_to( - Shell::Bash, - &mut SshAuthorizedOpt::command(), - "kanidm_ssh_authorizedkeys", - comp_dir.clone(), - ) - .ok(); - generate_to( - Shell::Zsh, - &mut SshAuthorizedOpt::command(), - "kanidm_ssh_authorizedkeys", - comp_dir.clone(), - ) - .ok(); + for shell in [Shell::Bash, Shell::Elvish, Shell::Fish, Shell::Zsh] { + generate_to( + shell, + &mut SshAuthorizedOpt::command(), + "kanidm_ssh_authorizedkeys", + comp_dir.clone(), + ) + .ok(); - generate_to( - Shell::Zsh, - &mut KanidmUnixParser::command(), - "kanidm_unix", - comp_dir.clone(), - ) - .ok(); - generate_to( - Shell::Bash, - &mut KanidmUnixParser::command(), - "kanidm_unix", - comp_dir, - ) - .ok(); + generate_to( + shell, + &mut KanidmUnixParser::command(), + "kanidm_unix", + comp_dir.clone(), + ) + .ok(); + } }