/ crates / auths-cli / src / config.rs
config.rs
 1  use std::path::PathBuf;
 2  use std::sync::Arc;
 3  
 4  use auths_core::config::EnvironmentConfig;
 5  use auths_core::signing::PassphraseProvider;
 6  
 7  #[derive(Debug, Clone, Copy, Default, clap::ValueEnum)]
 8  pub enum OutputFormat {
 9      #[default]
10      Text,
11      Json,
12  }
13  
14  pub struct CliConfig {
15      pub repo_path: Option<PathBuf>,
16      pub output_format: OutputFormat,
17      pub is_interactive: bool,
18      pub passphrase_provider: Arc<dyn PassphraseProvider + Send + Sync>,
19      pub env_config: EnvironmentConfig,
20  }
21  
22  impl CliConfig {
23      pub fn is_json(&self) -> bool {
24          matches!(self.output_format, OutputFormat::Json)
25      }
26  }