generate completions for elvish and fish (#3015)

This commit is contained in:
Adam C. Stephens 2024-09-03 19:50:59 -04:00 committed by GitHub
parent 399a1c0c52
commit 1161da69ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 43 deletions

View file

@ -41,6 +41,7 @@
- Anton Loukianov (antonl) - Anton Loukianov (antonl)
- fossdd - fossdd
- Wei Jian Gan (weijiangan) - Wei Jian Gan (weijiangan)
- adamcstephens
## Acknowledgements ## Acknowledgements

View file

@ -31,18 +31,13 @@ fn main() {
std::fs::create_dir(&comp_dir).expect("Unable to create completions dir"); std::fs::create_dir(&comp_dir).expect("Unable to create completions dir");
} }
generate_to( for shell in [Shell::Bash, Shell::Elvish, Shell::Fish, Shell::Zsh] {
Shell::Bash, generate_to(
&mut KanidmdParser::command(), shell,
"kanidmd", &mut KanidmdParser::command(),
comp_dir.clone(), "kanidmd",
) comp_dir.clone(),
.ok(); )
generate_to( .ok();
Shell::Zsh, }
&mut KanidmdParser::command(),
"kanidmd",
comp_dir,
)
.ok();
} }

View file

@ -34,7 +34,7 @@ fn main() -> Result<(), Error> {
std::fs::create_dir(&comp_dir).expect("Unable to create completions dir"); 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( generate_to(
shell, shell,
&mut SshAuthorizedOpt::command(), &mut SshAuthorizedOpt::command(),

View file

@ -30,33 +30,21 @@ fn main() {
std::fs::create_dir(&comp_dir).expect("Unable to create completions dir"); std::fs::create_dir(&comp_dir).expect("Unable to create completions dir");
} }
generate_to( for shell in [Shell::Bash, Shell::Elvish, Shell::Fish, Shell::Zsh] {
Shell::Bash, generate_to(
&mut SshAuthorizedOpt::command(), shell,
"kanidm_ssh_authorizedkeys", &mut SshAuthorizedOpt::command(),
comp_dir.clone(), "kanidm_ssh_authorizedkeys",
) comp_dir.clone(),
.ok(); )
generate_to( .ok();
Shell::Zsh,
&mut SshAuthorizedOpt::command(),
"kanidm_ssh_authorizedkeys",
comp_dir.clone(),
)
.ok();
generate_to( generate_to(
Shell::Zsh, shell,
&mut KanidmUnixParser::command(), &mut KanidmUnixParser::command(),
"kanidm_unix", "kanidm_unix",
comp_dir.clone(), comp_dir.clone(),
) )
.ok(); .ok();
generate_to( }
Shell::Bash,
&mut KanidmUnixParser::command(),
"kanidm_unix",
comp_dir,
)
.ok();
} }