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