Skip to main content

get_completion_class

Function get_completion_class 

Source
pub fn get_completion_class(shell: &str) -> Option<Box<dyn ShellComplete>>
Expand description

Get a shell completion implementation by name.

§Arguments

  • shell - The shell name (“bash”, “zsh”, or “fish”)

§Returns

Returns Some(Box<dyn ShellComplete>) if the shell is supported, None otherwise.

§Example

use click::completion::get_completion_class;

if let Some(completer) = get_completion_class("bash") {
    println!("Shell: {}", completer.name());
}