Skip to main content

timber_rs/
cli.rs

1use clap::Parser;
2
3#[derive(Parser, Debug)]
4#[clap(name = "timber")]
5#[clap(about = "Timber: Fell Your Logs Fast", long_about = None)]
6#[clap(version = env!("CARGO_PKG_VERSION"))]
7pub struct Args {
8    /// Log file to analyze
9    pub file: String,
10
11    /// Pattern to search for
12    #[clap(short, long)]
13    pub chop: Option<String>,
14
15    /// Filter by log level (ERROR, WARN, INFO, etc.)
16    #[clap(short, long)]
17    pub level: Option<String>,
18
19    /// Show time-based trends
20    #[clap(long)]
21    pub trend: bool,
22
23    /// Show summary statistics
24    #[clap(long)]
25    pub stats: bool,
26
27    /// Output results in JSON format
28    #[clap(long)]
29    pub json: bool,
30
31    /// Number of top error types to show (default: 5)
32    #[clap(long, default_value = "5")]
33    pub top_errors: usize,
34
35    /// Show unique messages in the output
36    #[clap(long)]
37    pub show_unique: bool,
38
39    /// Force parallel processing (default: auto-detect based on file size)
40    #[clap(long)]
41    pub parallel: bool,
42
43    /// Force sequential processing (overrides parallel)
44    #[clap(long)]
45    pub sequential: bool,
46
47    /// Only output the total log count (fast mode)
48    #[clap(long)]
49    pub count: bool,
50}