Skip to main content

uninstall_shell_completion

Function uninstall_shell_completion 

Source
pub fn uninstall_shell_completion<C>(shell: Shell) -> ConfigResult<()>
where C: CommandFactory,
Expand description

Removes shell completion files and managed shell startup-file blocks.

§Type Parameters

  • C: The consumer CLI parser type used to build the clap command.

§Arguments

  • shell: Shell whose completion file should be removed.

§Returns

Returns Ok(()) after the completion file is removed and any managed startup-file block has been removed. Existing startup files are backed up before being modified.

§Examples

use clap::Parser;
use clap_complete::aot::Shell;
use rust_config_tree::uninstall_shell_completion;

#[derive(Parser)]
#[command(name = "myapp")]
struct Cli {}

uninstall_shell_completion::<Cli>(Shell::Zsh)?;