fix new tpl sig

This commit is contained in:
Clément DOUIN
2021-09-18 21:45:26 +02:00
parent 8e2a703e2b
commit e065d8d905
9 changed files with 199 additions and 221 deletions
+2 -2
View File
@@ -1,13 +1,13 @@
//! Module related to completion handling.
//!
//! This module gathers all completion actions triggered by the CLI.
//! This module gathers all completion commands.
use anyhow::{anyhow, Context, Result};
use clap::{App, Shell};
use std::{io, str::FromStr};
/// Generate completion script from the given [`clap::App`] for the given shell slice.
pub fn generate<'a>(shell: Option<&'a str>, mut app: App<'a, 'a>) -> Result<()> {
pub fn generate<'a>(mut app: App<'a, 'a>, shell: Option<&'a str>) -> Result<()> {
let shell = Shell::from_str(shell.unwrap_or_default())
.map_err(|err| anyhow!(err))
.context("cannot parse shell")?;