···3030tokio = { version = "1.48.0", features = ["rt"] }3131toml = "0.9.8"3232tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }3333+clap_complete = "4.5.65"
+2
crates/gordian-cred/src/commands.rs
···11pub mod auth;22+pub mod generate;23pub mod git_credential;34pub mod git_setup;4556pub use auth::*;77+pub use generate::Generate;68pub use git_credential::*;79pub use git_setup::*;
+21
crates/gordian-cred/src/commands/generate.rs
···11+/// Generate shell completions22+#[derive(clap::Args)]33+pub struct Generate {44+ /// Shell name55+ shell: clap_complete::Shell,66+}77+88+impl crate::RunCommand for Generate {99+ type Error = std::convert::Infallible;1010+1111+ fn run(self) -> Result<(), Self::Error> {1212+ use clap::CommandFactory as _;1313+1414+ let mut command = crate::Arguments::command();1515+ let name = command.get_name().to_string();1616+1717+ clap_complete::generate(self.shell, &mut command, name, &mut std::io::stdout());1818+1919+ Ok(())2020+ }2121+}