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