use crate::cli::args::Cli;
use clap::CommandFactory;
pub fn generate_help() -> String {
Cli::command().render_help().to_string()
}
pub fn generate_command_help(command: &str) -> anyhow::Result<String> {
let mut cmd = Cli::command();
if let Some(subcommand) = cmd.find_subcommand_mut(command) {
Ok(subcommand.render_help().to_string())
} else {
Err(anyhow::anyhow!("Command '{}' not found", command))
}
}
pub fn get_log_level(verbose: u8) -> &'static str {
match verbose {
0 => "info",
1 => "debug",
2 => "trace",
_ => "trace,hyper=debug,tower=debug", }
}