From a5831be959f1ba3461ce90f2376228292bdf6fd1 Mon Sep 17 00:00:00 2001 From: fdai7374 Date: Sat, 4 Feb 2023 14:38:32 +0100 Subject: [PATCH] feat: add add german flag style to blahaj --- src/builtins/blahaj.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/builtins/blahaj.rs b/src/builtins/blahaj.rs index 8f809fe..2c28970 100644 --- a/src/builtins/blahaj.rs +++ b/src/builtins/blahaj.rs @@ -2,6 +2,7 @@ use crate::builtins::{Builtin, BuiltinConfig}; use crate::error::ShellError; use colored::Colorize; + pub struct Blahaj; impl Builtin for Blahaj { @@ -33,6 +34,8 @@ impl Builtin for Blahaj { trans_flag(blahaj); } else if args[0].eq("-p") { pride_flag(blahaj); + }else if args[0].eq("-ger"){ + german(blahaj); } } Ok(()) @@ -68,4 +71,16 @@ fn pride_flag(blahaj: &str) { } index = index + 1; } -} \ No newline at end of file +} + +fn german (blahaj: &str){ + + for (index,lines) in blahaj.lines().enumerate(){ + if index<=7{ + println!("{}",lines.truecolor(30,30,30)); + }else if index>6&&index<=12 { + println!("{}",lines.truecolor(255,0,0)); + }else { println!("{}", lines.truecolor(255,255,0)); } + } + +}