Colorized ouput

This commit is contained in:
Andrew Schott 2024-03-06 00:43:53 -06:00
parent ebbbf18236
commit 3f31bfc328
40 changed files with 15 additions and 15 deletions

View file

@ -14,9 +14,9 @@ fn trim_newline(s: &mut String) {
fn main() {
{
// Tell user that we are going to start the update procedure
cprintln!("osupdater : rust edition\n");
println!("This tool will locate any package managers on your system and run the update tool appropriate to it.\n");
println!("Looking for native package managers.");
cprintln!("<bold><rev><white>osupdater : rust edition</white></rev></bold>\n");
cprintln!("<bold><rev><white>This tool will locate any package managers on your system and run the update tool appropriate to it.</white></rev></bold>\n");
cprintln!("<bold><rev><white>Looking for native package managers.</white></rev></bold>\n");
let find_sudo = Command::new("which")
.arg("sudo").stdout(Stdio::piped()).output().unwrap();
let mut sudo_bin = String::from_utf8(find_sudo.stdout).unwrap();
@ -68,7 +68,7 @@ fn main() {
trim_newline(&mut pip_review_bin);
//apt
println!("Checking for apt");
cprintln!("<bold><rev><magenta>Checking for apt</magenta></rev></bold>");
let path = Path::new(&apt_bin);
if path.exists(){
let mut cmd =
@ -86,7 +86,7 @@ fn main() {
}
// dnf
println!("Checking for dnf");
cprintln!("<bold><rev><blue>hecking for dnf</blue></rev></bold>");
let path = Path::new(&dnf_bin);
if path.exists(){
let mut cmd =
@ -98,7 +98,7 @@ fn main() {
}
// pacman
println!("Checking for pacman");
cprintln!("<bold><rev><cyan>Checking for pacman</cyan></rev></bold>");
let path = Path::new(&pacman_bin);
if path.exists(){
let mut cmd =
@ -110,7 +110,7 @@ fn main() {
}
// urpmi
println!("Checking for urpmi");
cprintln!("<bold><rev><white>Checking for urpmi</white></rev></bold>");
let path = Path::new(&urpmi_bin);
if path.exists(){
let mut cmd =
@ -122,7 +122,7 @@ fn main() {
}
// yum
println!("Checking for yum");
cprintln!("<bold><rev><red>Checking for yum</red></rev></bold>");
let path = Path::new(&yum_bin);
if path.exists(){
let mut cmd =
@ -134,7 +134,7 @@ fn main() {
}
// zypper
println!("Checking for zypper");
cprintln!("<bold><rev><green>Checking for zypper</green></rev></bold>");
let path = Path::new(&zypper_bin);
if path.exists(){
let mut cmd =
@ -146,11 +146,11 @@ fn main() {
}
// Check container formats
println!("Checking application containers");
cprintln!("<bold><rev><white>Checking application containers</white></rev></bold>");
// flatpak
println!("Checking for user flatpak installs");
cprintln!("<bold><rev><blue>Checking for user flatpak installs</blue></rev></bold>");
let path = Path::new(&flatpak_bin);
if path.exists(){
let mut cmd =
@ -160,7 +160,7 @@ fn main() {
.spawn().unwrap();
let _output = cmd.wait();
}
println!("Checking for system flatpak installs");
cprintln!("<bold><rev><blue>Checking for system flatpak installs</blue></rev></bold>");
let path = Path::new(&flatpak_bin);
if path.exists(){
let mut cmd =
@ -172,7 +172,7 @@ fn main() {
}
// snap
println!("Checking for user snap installation");
cprintln!("<bold><rev><magenta>Checking for user snap installation</magenta></rev></bold>");
let path = Path::new(&snap_bin);
if path.exists(){
let mut cmd =
@ -182,7 +182,7 @@ fn main() {
.spawn().unwrap();
let _output = cmd.wait();
}
println!("Checking for system snap installation");
cprintln!("<bold><rev><magenta>Checking for system snap installation</magenta></rev></bold>");
let path = Path::new(&snap_bin);
if path.exists(){
let mut cmd =
@ -194,7 +194,7 @@ fn main() {
}
//Python
println!("Updating Python user installation via pip-review");
cprintln!("<bold><rev><red>Updating Python user installation via pip-review</red></rev></bold>");
let path = Path::new(&pip_review_bin);
if path.exists(){
let mut cmd =