cli/cli/cli_args/commands_query.rs
1// SPDX-License-Identifier: Apache-2.0
2//! `heddle query` — structured query over the operation log.
3
4use clap::Args;
5
6#[derive(Clone, Debug, Args)]
7pub struct QueryArgs {
8 /// Show line-by-line attribution for a tracked file.
9 #[arg(long, value_name = "FILE")]
10 pub attribution: Option<String>,
11 /// State to inspect with `--attribution`. Accepts short or full
12 /// state IDs, marker names, `HEAD`, `@`, or `HEAD~N`.
13 #[arg(long, requires = "attribution")]
14 pub state: Option<String>,
15 /// Include applicable context annotations with `--attribution`.
16 #[arg(long, requires = "attribution")]
17 pub context: bool,
18 /// Filter by actor email.
19 #[arg(long)]
20 pub actor: Option<String>,
21 /// Lower bound. Accepts RFC3339 (`2026-05-04T12:00:00Z`) or
22 /// humantime (`1h`, `2d`, `30m`).
23 #[arg(long)]
24 pub since: Option<String>,
25 /// Upper bound, same formats as `--since`.
26 #[arg(long)]
27 pub until: Option<String>,
28 /// Filter by signal kind (e.g. `novelty`, `invariant_adjacency`).
29 #[arg(long)]
30 pub signal: Option<String>,
31 /// Filter by symbol (free-form `<file>:<symbol>` string).
32 #[arg(long)]
33 pub symbol: Option<String>,
34 /// Filter by thread name.
35 #[arg(long)]
36 pub thread: Option<String>,
37 /// Restrict to specific oplog verbs. Repeat to allow multiple.
38 #[arg(long = "verb")]
39 pub verbs: Vec<String>,
40 /// Maximum hits to return.
41 #[arg(long, default_value = "100")]
42 pub limit: u32,
43 /// Include checkpoint entries (excluded by default).
44 #[arg(long)]
45 pub include_checkpoints: bool,
46}