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
use clap::Subcommand;
use super::AuthTarget;
/// What to ask of the request log.
#[derive(Debug, Subcommand)]
pub enum LogsOp {
/// Shape of the log: exchanges, records, statuses, time span, size.
Summary {
/// Restrict to one token's log directory, by its hashed name.
///
/// Named `--token-id` because `--token` means a credential in `with`,
/// `server use` and `clients setup`, and one flag name meaning two
/// things is what makes a CLI unusable from memory (issue #314). The
/// old spelling is still accepted.
#[arg(long = "token-id", alias = "token", value_name = "HASHED_NAME")]
token: Option<String>,
/// Emit JSON, for a monitoring check rather than a human.
#[arg(long)]
json: bool,
#[command(flatten)]
target: AuthTarget,
},
/// Anomalies worth a name, with the correlation ids to inspect.
///
/// Exits non-zero when any are found, so it works as a health gate.
Anomalies {
/// Restrict to one token's log directory, by its hashed name.
#[arg(long = "token-id", alias = "token", value_name = "HASHED_NAME")]
token: Option<String>,
/// Emit JSON, for a monitoring check rather than a human.
#[arg(long)]
json: bool,
#[command(flatten)]
target: AuthTarget,
},
/// One exchange, decoded and in order.
Show {
correlation_id: String,
/// Restrict to one token's log directory, by its hashed name.
#[arg(long = "token-id", alias = "token", value_name = "HASHED_NAME")]
token: Option<String>,
#[command(flatten)]
target: AuthTarget,
},
}