Skip to main content

rusty_commit/output/
prelude.rs

1//! Prelude types for output module.
2
3use clap::ValueEnum;
4
5/// Output format for commands.
6#[derive(Debug, Clone, Copy, Default, ValueEnum)]
7pub enum OutputFormat {
8    /// Beautiful colored output (default).
9    #[default]
10    Pretty,
11    /// Machine-readable JSON output.
12    Json,
13    /// Markdown-formatted output.
14    Markdown,
15}
16
17/// Represents the verbosity level for output.
18#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
19#[allow(dead_code)]
20pub enum OutputLevel {
21    /// Quiet mode - minimal output.
22    Quiet,
23    /// Normal mode - standard output.
24    #[default]
25    Normal,
26    /// Verbose mode - detailed output.
27    Verbose,
28    /// Debug mode - includes timing and internal details.
29    Debug,
30}
31
32#[allow(dead_code)]
33impl OutputLevel {
34    pub fn is_verbose_or_higher(&self) -> bool {
35        matches!(self, Self::Verbose | Self::Debug)
36    }
37
38    pub fn is_debug(&self) -> bool {
39        matches!(self, Self::Debug)
40    }
41}