Improve readability

This commit is contained in:
2023-09-07 16:05:38 +03:00
parent 2334c1a8f3
commit 70136e9074

View File

@@ -270,7 +270,7 @@ fn main() {
println!( println!(
"{}", "{}",
format!( format!(
"Exit code [{}] / stdout {} bytes / stderr {} bytes", "Exit code [{}] | std out/err [{}/{}] bytes",
code_string, code_string,
output.stdout.len(), output.stdout.len(),
output.stderr.len() output.stderr.len()
@@ -283,8 +283,13 @@ fn main() {
Ok(stdout) => match stdout.as_str() { Ok(stdout) => match stdout.as_str() {
"" => {} "" => {}
_ => { _ => {
let prefix = if output.exit_status != 0 {
format!("{}", "".cyan())
} else {
format!("{}", "".green())
};
for line in stdout.lines() { for line in stdout.lines() {
println!("{} {}", "".green(), line); println!("{} {}", prefix, line);
} }
} }
}, },
@@ -306,4 +311,4 @@ fn main() {
} else { } else {
warn!("Stopped"); warn!("Stopped");
} }
} }