cordance-cli 0.1.1

Cordance CLI — installs the `cordance` binary. The umbrella package `cordance` re-exports this entry; either install command works.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! `cordance completions` — shell completion scripts. LANE-V1-COMPLETIONS.

use anyhow::Result;
use clap_complete::{generate, Shell};
use std::io;
use std::str::FromStr;

pub fn run(shell: &str, mut app: clap::Command) -> Result<()> {
    let shell = Shell::from_str(shell).map_err(|_| {
        anyhow::anyhow!("Unknown shell: '{shell}'. Try: bash, zsh, fish, powershell")
    })?;
    generate(shell, &mut app, "cordance", &mut io::stdout());
    Ok(())
}