use anyhow::Result;
pub mod config;
pub mod debug;
pub mod export;
pub mod paths;
pub mod test;
pub mod validate;
pub mod validation;
#[allow(dead_code)]
pub type CommandResult<T = ()> = Result<T>;
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub struct CommandContext {
pub use_color: bool,
pub verbosity: u8,
pub output_format: crate::cli::OutputFormat,
}
impl CommandContext {
#[allow(dead_code)]
pub fn new(cli: &crate::cli::Cli) -> Self {
Self {
use_color: !cli.no_color,
verbosity: cli.verbose,
output_format: cli.output.clone(),
}
}
#[allow(dead_code)]
pub fn is_verbose(&self) -> bool {
self.verbosity > 0
}
#[allow(dead_code)]
pub fn is_debug(&self) -> bool {
self.verbosity > 1
}
#[allow(dead_code)]
pub fn is_trace(&self) -> bool {
self.verbosity > 2
}
}