ab-av1 0.4.3

AV1 encoding with fast VMAF sampling
use anyhow::anyhow;
use clap::{IntoApp, Parser};
use clap_complete::Shell;
use std::str::FromStr;

/// Print shell completions.
#[derive(Parser)]

pub struct Args {
    /// Shell.
    #[clap(value_parser, default_value = "bash")]
    shell: String,
}

pub fn print_completions(Args { shell }: Args) -> anyhow::Result<()> {
    clap_complete::generate(
        Shell::from_str(&shell).map_err(|e| anyhow!("Shell {e}"))?,
        &mut crate::Command::command(),
        "ab-av1",
        &mut std::io::stdout(),
    );
    Ok(())
}