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
//! Agent-native payload reduction flags, shared by every subcommand.
//!
//! # Why these live in their own struct
//!
//! Declaring *how much of the payload reaches the caller* is a different concern from
//! declaring *how the request is made*. The transport knobs ([`crate::cli::Cli`]:
//! timeouts, retries, cache) describe the fetch; these describe the emission. Keeping
//! them apart means a reduction knob can be added without touching the transport
//! surface, and [`crate::agent_ops`] takes one value instead of a growing argument list.
//!
//! # Query limits versus emission limits
//!
//! `search-in-crate --limit` and `search-crates --per-page` bound the **query**: they
//! decide how much upstream work happens. [`AgentArgs::max_items`] bounds the
//! **emission**: it decides how much of the already-computed result is written to
//! stdout. The names differ because the things differ — and because a second `--limit`
//! would collide, which clap rejects outright with "Long option names must be unique
//! for each argument".
use Args;
/// Payload reduction knobs applied to the JSON envelope before it is written.
///
/// Every field is `global = true`, so the flags are accepted before or after the
/// subcommand. See [`crate::agent_ops`] for the fixed application order.