From c5ca551c0b735930d0469cad877b541c37a3defb Mon Sep 17 00:00:00 2001 From: pwnwriter Date: Sat, 2 Sep 2023 21:13:39 +0545 Subject: [PATCH] chore(colors): removed color printings --- src/cli/ascii.rs | 8 +++++--- src/cli/screenshot.rs | 18 ++++++++---------- src/colors.rs | 14 -------------- src/main.rs | 1 - 4 files changed, 13 insertions(+), 28 deletions(-) delete mode 100644 src/colors.rs diff --git a/src/cli/ascii.rs b/src/cli/ascii.rs index 1fbff40..864aae0 100644 --- a/src/cli/ascii.rs +++ b/src/cli/ascii.rs @@ -1,7 +1,9 @@ use colored::Colorize; -// pub const BAR: &str = r" -// ──────────────────────────────── -// "; +pub const BAR: &str = r" +──────────────────────────────── +"; + +pub const RESET: &str = "\x1B[0m"; //( resets the text color to the default) pub fn splash() -> String { let logo = r" diff --git a/src/cli/screenshot.rs b/src/cli/screenshot.rs index a16a4ab..6d98efe 100644 --- a/src/cli/screenshot.rs +++ b/src/cli/screenshot.rs @@ -1,4 +1,4 @@ -use crate::colors::*; +use crate::cli::ascii::{BAR, RESET}; use crate::log::error; use chromiumoxide::browser::{Browser, BrowserConfig}; use chromiumoxide::handler::viewport::Viewport; @@ -70,7 +70,7 @@ pub async fn run( fs::create_dir(&outdir).await?; } - let urls: Vec; // Define the 'urls' variable outside the match statement + let urls: Vec; #[allow(unreachable_patterns)] match stdin { @@ -156,16 +156,14 @@ async fn take_screenshots( ) .await?; + #[allow(clippy::useless_format)] let _info = Columns::from(vec![ format!("{RESET}").split('\n').collect::>(), vec![ - &format!("{BLUE}"), - &format!("{GREEN}[{CYAN}  {GREEN}] URL={GREEN}{}", url), - &format!( - "{BLUE}[{CYAN}  {YELLOW}] Title={GREEN}{}", - page.get_title().await?.unwrap_or_default() - ), - &format!("{BLUE}[{CYAN} ﯜ {YELLOW}] Status={GREEN}{}", _res.status()), + &format!("{BAR}"), + &format!(" URL = {}", url), + &format!("Title = {}", page.get_title().await?.unwrap_or_default()), + &format!("Status = {}", _res.status()), ], ]) .set_tabsize(0) @@ -174,7 +172,7 @@ async fn take_screenshots( println!("{_info}"); } } else { - println!("{RED}[-] Timed out URL = {YELLOW}{}", url); + println!("[-] Timed out URL = {}", url); } } diff --git a/src/colors.rs b/src/colors.rs deleted file mode 100644 index 7334fd6..0000000 --- a/src/colors.rs +++ /dev/null @@ -1,14 +0,0 @@ -//------------ ANSI Colors (FG & BG) ----------// -//-------------- MIT // PwnWriter ------------// - -pub const CYAN: &str = "\x1b[36m"; //( bright, light blue-green color) -pub const GREEN: &str = "\x1b[32m"; //( bright, medium green color) -pub const BLUE: &str = "\x1b[34m"; //( bright, medium blue color) -pub const RED: &str = "\x1b[31m"; //( bright, medium red color) -pub const YELLOW: &str = "\x1B[32m"; //( bright, medium yellow color) -pub const YELLOW_BRIGHT: &str = "\x1B[93m"; //( very bright, light yellow color) -pub const RESET: &str = "\x1B[0m"; //( resets the text color to the default) - -// unused colors rn :- -//pub const MAGENTAA: &str = "\x1b[35m"; //( bright, medium pinkish-purple color) -//pub const WHITE: &str = "\x1B[37m"; //( bright, pale gray color) diff --git a/src/main.rs b/src/main.rs index 5b47934..ea4ca1f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,6 @@ mod cli; mod log; use cli::args; -mod colors; use clap::Parser; #[tokio::main]