Group volume mounts by scope in config output
Display mounts as sublists under their scope header instead of a flat
list with inline scope tags. Each scope header shows the scope name
and config file path (when applicable). Example:
Volume mounts
builtin
✓ /path/.pi → /root/.pi
user (~/.config/ramekin/config.kdl)
✓ /path/.config/git → /root/.config/git (ro)
diff --git a/src/main.rs b/src/main.rs
index 5d400e4..fe9dd99 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -187,26 +187,29 @@ impl Ramekin {
if merged.is_empty() {
println!(" (none)");
} else {
+ let mut current_scope = None;
for (scope, m) in &merged {
+ if current_scope != Some(*scope) {
+ current_scope = Some(*scope);
+ let label = self
+ .config
+ .layers
+ .iter()
+ .find(|l| l.scope == *scope)
+ .and_then(|l| l.path.as_ref())
+ .map(|p| format!(" {} ({})", scope, p.display()))
+ .unwrap_or_else(|| format!(" {scope}"));
+ println!("{label}");
+ }
println!(
- " {} {} → {} ({})",
+ " {} {} → {}",
check(&m.source),
m.source.display(),
- m.display_target(),
- scope,
+ m.display_target()
);
}
}
- println!();
- println!("Config sources");
- for layer in &self.config.layers {
- match layer.path {
- Some(ref path) => println!(" {} {} {}", check(path), layer.scope, path.display()),
- None => println!(" ✓ {}", layer.scope),
- };
- }
-
println!();
println!("Dockerfile");
match &self.custom_dockerfile {