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
62
63
64
65
66
67
use clap::Parser;
use std::path::PathBuf;
#[derive(Parser, Clone)]
pub struct AddArgs {
/// Process name to track (positional). Use '_global' for global monitoring.
#[arg(value_name = "CMD")]
pub cmd: Option<String>,
/// Path to monitor
#[arg(long, value_name = "PATH")]
pub path: Option<PathBuf>,
/// Watch subdirectories recursively
#[arg(short)]
pub recursive: bool,
/// Event types to monitor (repeatable; use "all" for all 14 types). Controls kernel mask.
#[arg(short, long, value_name = "TYPE")]
pub types: Vec<String>,
/// Size filter with operator (required: >=, >, <=, <, =). e.g. >1MB, >=500KB, <100MB, =0
#[arg(short, long, value_name = "SIZE")]
pub size: Option<String>,
}
#[derive(Parser, Clone)]
pub struct QueryArgs {
/// Cmd group to query (positional). Use '_global' for global events.
#[arg(value_name = "CMD")]
pub cmd: Option<String>,
/// Path prefix filter(s) applied to event.path. Repeatable.
#[arg(short, long, value_name = "PATH")]
pub path: Vec<PathBuf>,
/// Time filter with operator (repeatable: >1h for since, <2026-05-01 for until)
#[arg(short, long, value_name = "FILTER")]
pub time: Vec<String>,
}
#[derive(Parser, Clone)]
pub struct ChangesArgs {
/// Cmd group to query (positional). Use '_global' for global events.
#[arg(value_name = "CMD")]
pub cmd: Option<String>,
/// Path prefix filter(s) applied to event.path. Repeatable.
#[arg(short, long, value_name = "PATH")]
pub path: Vec<PathBuf>,
/// Time filter with operator (repeatable: >1h for since, <2026-05-01 for until)
#[arg(short, long, value_name = "FILTER")]
pub time: Vec<String>,
}
#[derive(Parser, Clone)]
pub struct CleanArgs {
/// Cmd group to clean (positional). Use '_global' for the global log.
#[arg(value_name = "CMD")]
pub cmd: Option<String>,
/// Time filter with operator (e.g. >30d — delete entries older than 30 days)
#[arg(short, long, value_name = "FILTER")]
pub time: Option<String>,
/// Size limit for log file truncation with operator (e.g. >500MB, >=1GB)
#[arg(short, long)]
pub size: Option<String>,
/// Dry run — preview without modifying
#[arg(short, long)]
pub dry_run: bool,
}