himalaya 0.7.0

Command-line interface for email management.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Module related to completion handling.
//!
//! This module gathers all completion commands.  

use anyhow::Result;
use clap::Command;
use clap_complete::Shell;
use std::io::stdout;

/// Generates completion script from the given [`clap::App`] for the given shell slice.
pub fn generate<'a>(mut cmd: Command, shell: Shell) -> Result<()> {
    let name = cmd.get_name().to_string();
    clap_complete::generate(shell, &mut cmd, name, &mut stdout());
    Ok(())
}