|
|
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, args: Vec<String>) -> Result<(), ShellError> {
let blahaj = "
((/
,(((/
/((((( (/
((((#(( (//
(((((((. *(((/
/(######/ *((((/
*//%#####((/ ((#((/
,*/********/////////////////(//* (%* ,((##((
,*/((///(//////////((/(///////(/////(////*,(*#((/(/((//////###(###(/(
/(((((((//((///((////((((((/(((((((((((((((((/(((##((#%(##(/((///*(&#(##/
/#((%(#(((((//#((((((((((((((((((((((((#(((((((((((/##(((((//((//* ####(/
(((###(###(#(#####(###############((#((((((((/((//(((#/(///// ,,
,(###%####%&%#############(#(#(####(((((((/(((/////*//,
. .....*#(#######(((###(#(##(##(((/(/(/////,
.. ....,..........,..*#%#######/(
.. .............,*%%%%#%((((/
**,,,****//*(##((###(#(((
&#(#/#((((((((#";
if args.is_empty() {
println!("{}", blahaj);
} else {
if args[0].eq("-t") {
trans_flag(blahaj);
}
}
Ok(())
}
}
fn trans_flag(blahaj: &str) {
for (index, lines) in blahaj.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)); }
}
}
|