Add shell completion and manpage generation (#233)

This commit is contained in:
Marcin Puc
2022-11-26 20:42:35 +01:00
committed by GitHub
parent 37b900c56a
commit f6ec6c76db
5 changed files with 51 additions and 80 deletions

View File

@@ -6,6 +6,7 @@ use std::process::Command;
use std::{env, fs};
use clap::{ArgEnum, Parser};
use clap_complete::Shell;
use color_eyre::eyre;
use color_eyre::eyre::Context;
use color_eyre::eyre::Result;
@@ -489,6 +490,14 @@ pub struct CommandLineArgs {
/// See: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/struct.EnvFilter.html
#[clap(long, default_value = "info")]
pub log_filter: String,
/// Print completion script for the given shell and exit
#[clap(long, arg_enum, hide = true)]
pub gen_completion: Option<Shell>,
/// Print roff manpage and exit
#[clap(long, hide = true)]
pub gen_manpage: bool,
}
impl CommandLineArgs {