git.delta.rocks / jrsonnet / refs/commits / d9405376effd

difftreelog

source

cmds/fleet/src/cmds/complete.rs477 Bsourcehistory
1use std::io::stdout;23use clap::{Command, Parser};4use clap_complete::Shell;56#[derive(Parser)]7pub struct Complete {8	/// For which shell to generate the completions9	#[arg(long, short)]10	shell: Shell,11}1213impl Complete {14	pub fn run(&self, mut command: Command) {15		let Self { shell } = self;1617		let bin_name = command18			.get_bin_name()19			.unwrap_or_else(|| command.get_name())20			.to_owned();21		clap_complete::generate(*shell, &mut command, &bin_name, &mut stdout());22	}23}