img_tool/cmd/
resize.rs

1use std::io;
2
3use clap::CommandFactory;
4use clap_complete::{generate, Shell};
5
6use super::cli::{Cli, Cmd};
7use crate::config::CliConfig;
8
9#[derive(clap::Parser, Debug)]
10pub struct Completion {
11  /// > completion_derive.fish
12  #[clap(required = true, value_enum)]
13  shell: Shell,
14}
15
16impl Cmd for Completion {
17  fn apply(&self) {
18    todo!()
19  }
20
21  fn call(&self, _config: &CliConfig) {
22    let mut cmd = Cli::command();
23    let name = cmd.get_name().to_string();
24
25    generate(self.shell, &mut cmd, name, &mut io::stdout());
26  }
27}