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
68
69
70
71
72
73
74
75
76
77
78
79
//! Config system for `roba`.
//!
//! A `roba.toml` file holds two kinds of content:
//!
//! - **Top-level keys** -- defaults applied to every call in this dir
//! - **`[profile.NAME]` tables** -- named overlays opted into with
//! `--profile NAME` or `ROBA_PROFILE=NAME`
//!
//! # Resolution
//!
//! For any setting, the highest layer that defines it wins:
//!
//! 1. CLI flag
//! 2. `[profile.NAME]` overlay (when activated)
//! 3. Top-level keys in `roba.toml` files
//! 4. roba's built-in defaults
//! 5. claude's defaults
//!
//! (The `ROBA_<PARAM>` env-var override layer slots in between CLI
//! and the profile overlay; it lands in a follow-up PR.)
//!
//! # File discovery
//!
//! 1. **User-level:** `$XDG_CONFIG_HOME/roba.toml` or
//! `~/.config/roba.toml`
//! 2. **Project chain:** every ancestor `roba.toml` walking up from
//! cwd to the git root (or `~` if no git root); farther-from-cwd
//! files are loaded first so closer files override on conflict
//!
//! `ROBA_PROFILES_FILE` (point-at-an-extra-file env var) was retired
//! in favour of the per-knob `ROBA_<PARAM>` override layer; see
//! [`crate::env`].
//!
//! # Merge semantics
//!
//! When the same key appears in multiple files (top-level or inside
//! a `[profile.NAME]` of the same name):
//!
//! - Scalars: closer-to-cwd file wins.
//! - Lists: concat. Closer-file items appended after farther ones.
//! - Maps (vars): per-key merge with closer winning on key conflicts.
//!
//! CLI flags then override the merged result via [`merge_into_args`].
//!
//! # Module layout
//!
//! - [`types`]: the [`Profile`] / [`ConfigFile`] / [`Pool`] data types
//! - [`pool`]: file discovery + loading into a merged [`Pool`]
//! - [`mod@resolve`]: picking the effective profile and merging it into args
//! - [`cmd`]: the `roba profile <action>` subcommand runners
pub use ;
pub use ;
pub use ;
pub use ;
use PathBuf;
/// Resolve the user's home directory from `HOME` (Unix) or
/// `USERPROFILE` (Windows). Shared by [`pool::user_config_path`] and
/// [`resolve`]'s `~/`-expansion.
pub