cbc46ad8eb
- clean up dead code - fix lints - move Session type to legacy module - refactor service names into constants - refactor build_url to be less restrictive for service names - refactor most commands into their own modules
18 lines
486 B
Rust
18 lines
486 B
Rust
use clap::CommandFactory;
|
|
|
|
use super::*;
|
|
|
|
#[derive(Debug, Clone, Parser)]
|
|
#[clap(about = "Generate shell completions")]
|
|
pub struct CompletionsCommand {
|
|
#[clap(short, long, arg_enum, help = "The shell to generate completions for.")]
|
|
pub shell: Shell,
|
|
}
|
|
|
|
impl ConstCommand for CompletionsCommand {
|
|
fn execute(&self) -> anyhow::Result<()> {
|
|
let mut app = Args::command_for_update();
|
|
clap_complete::generate(self.shell, &mut app, "steamguard", &mut std::io::stdout());
|
|
Ok(())
|
|
}
|
|
}
|