From e7aa9e0f5a9f273a03713423b7fd79e56d9ddc3a Mon Sep 17 00:00:00 2001 From: fdai7374 Date: Fri, 3 Feb 2023 21:40:51 +0100 Subject: [PATCH] feat: add trans flag style for blahaj --- src/builtins/blahaj.rs | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/builtins/blahaj.rs b/src/builtins/blahaj.rs index caa4bd8..763bf0b 100644 --- a/src/builtins/blahaj.rs +++ b/src/builtins/blahaj.rs @@ -1,11 +1,12 @@ use crate::builtins::{Builtin, BuiltinConfig}; use crate::error::ShellError; +use colored::Colorize; pub struct Blahaj; impl Builtin for Blahaj { - fn execute(&mut self, _: &mut BuiltinConfig, _: Vec) -> Result<(), ShellError> { - println!(" + fn execute(&mut self, _: &mut BuiltinConfig, args: Vec) -> Result<(), ShellError> { + let shonk=" ((/ ,(((/ /((((( (/ @@ -23,7 +24,24 @@ impl Builtin for Blahaj { .. ....,..........,..*#%#######/( .. .............,*%%%%#%((((/ **,,,****//*(##((###(#((( - &#(#/#((((((((#"); + &#(#/#((((((((#"; + if args.is_empty() { + println!("{}",shonk); + }else { + if args[0].eq("-t") { + trans_flag(shonk); + } + } Ok(()) } +} + +fn trans_flag(shonk: &str){ + for (index, lines) in shonk.lines().enumerate() { + if index%4==0 { + println!("{}",lines.truecolor(91,206,250)); + }else if index%2==0 { + println!("{}", lines.white()); + }else { println!("{}", lines.truecolor(245,169,184));} + } } \ No newline at end of file