use clap::Command as ClapCommand;
use clap::{CommandFactory, Parser};
use clap_complete::{generate, Generator, Shell};
use forc_util::ForcResult;
#[derive(Debug, Parser)]
pub struct Command {
#[clap(short = 'S', long)]
shell: Shell,
}
pub(crate) fn exec(command: Command) -> ForcResult<()> {
let mut cmd = super::super::Opt::command();
print_completions(command.shell, &mut cmd);
Ok(())
}
fn print_completions<G: Generator>(gen: G, cmd: &mut ClapCommand) {
generate(gen, cmd, cmd.get_name().to_string(), &mut std::io::stdout());
}