From a47a130d4241a05bac678c24999637a50a5c6239 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Tue, 3 Dec 2024 18:51:56 +0100 Subject: [PATCH] Change sq config inspect paths to use stdout. - Change `sq config inspect paths ` to use `stdout`, not `stderr`, for its main output. - See #342. --- src/commands/config/inspect.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/commands/config/inspect.rs b/src/commands/config/inspect.rs index ed6ec45c..e88f8cb8 100644 --- a/src/commands/config/inspect.rs +++ b/src/commands/config/inspect.rs @@ -141,24 +141,26 @@ fn network(sq: Sq, _: inspect::network::Command) -> Result<()> { /// Implements `sq config inspect paths`. fn paths(sq: Sq, _: inspect::paths::Command) -> Result<()> { + let o = &mut std::io::stdout(); + // Whether we have emitted anything. let mut dirty = false; // Formats a path. let mut p = |path: &Path, name: &str, description: &str| -> Result<()> { if dirty { - weprintln!(); + wwriteln!(o); } dirty = true; - weprintln!(initial_indent = " - ", "{}", name); - weprintln!(initial_indent = " - ", "{}", path.display()); + wwriteln!(stream=o, initial_indent = " - ", "{}", name); + wwriteln!(stream=o, initial_indent = " - ", "{}", path.display()); if ! path.exists() { - weprintln!(initial_indent = " - ", "does not exist"); + wwriteln!(stream=o, initial_indent = " - ", "does not exist"); } - weprintln!(initial_indent = " - ", "{}", description); + wwriteln!(stream=o, initial_indent = " - ", "{}", description); Ok(()) };