mirror of
https://github.com/house-of-vanity/rexec.git
synced 2025-07-07 00:54:06 +00:00
Improve readability
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1066,7 +1066,7 @@ checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
|
||||
|
||||
[[package]]
|
||||
name = "rexec"
|
||||
version = "1.0.6"
|
||||
version = "1.0.8"
|
||||
dependencies = [
|
||||
"brace-expand",
|
||||
"clap 4.3.4",
|
||||
|
54
src/main.rs
54
src/main.rs
@ -52,14 +52,6 @@ struct Args {
|
||||
)]
|
||||
noconfirm: bool,
|
||||
|
||||
#[arg(
|
||||
short = 'b',
|
||||
long,
|
||||
default_value_t = true,
|
||||
help = "Use formatting for better human readability"
|
||||
)]
|
||||
beauty: bool,
|
||||
|
||||
#[arg(short, long, default_value_t = 100)]
|
||||
parallel: i32,
|
||||
}
|
||||
@ -275,37 +267,41 @@ fn main() {
|
||||
} else {
|
||||
format!("{}", output.exit_status.to_string().red())
|
||||
};
|
||||
println!("{}", format!("Exit code [{}] / stdout {} bytes / stderr {} bytes", code_string, output.stdout.len(), output.stderr.len()).bold());
|
||||
println!(
|
||||
"{}",
|
||||
format!(
|
||||
"Exit code [{}] / stdout {} bytes / stderr {} bytes",
|
||||
code_string,
|
||||
output.stdout.len(),
|
||||
output.stderr.len()
|
||||
)
|
||||
.bold()
|
||||
);
|
||||
|
||||
if !args.code {
|
||||
match String::from_utf8(output.stdout) {
|
||||
Ok(stdout) => {
|
||||
match stdout.as_str() {
|
||||
"" => {}
|
||||
_ => {
|
||||
println!("{}", "STDOUT".bold().blue());
|
||||
for line in stdout.lines() {
|
||||
println!("{} {}", "║".green(), line);
|
||||
}
|
||||
Ok(stdout) => match stdout.as_str() {
|
||||
"" => {}
|
||||
_ => {
|
||||
println!("{}", "STDOUT".bold().blue());
|
||||
|
||||
for line in stdout.lines() {
|
||||
println!("{} {}", "║".green(), line);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
Err(_) => {}
|
||||
}
|
||||
match String::from_utf8(output.stderr) {
|
||||
Ok(stderr) => {
|
||||
match stderr.as_str() {
|
||||
"" => {}
|
||||
_ => {
|
||||
println!("{}", "STDERR".bold().bright_red());
|
||||
for line in stderr.lines() {
|
||||
println!("{} {}", "║".red(), line);
|
||||
}
|
||||
Ok(stderr) => match stderr.as_str() {
|
||||
"" => {}
|
||||
_ => {
|
||||
println!("{}", "STDERR".bold().bright_red());
|
||||
for line in stderr.lines() {
|
||||
println!("{} {}", "║".red(), line);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
Err(_) => {}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user