You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.9 KiB

  1. use crate::builtins::{Builtin, BuiltinConfig};
  2. use crate::error::ShellError;
  3. use colored::Colorize;
  4. pub struct Blahaj;
  5. impl Builtin for Blahaj {
  6. fn execute(&mut self, _: &mut BuiltinConfig, args: Vec<String>) -> Result<(), ShellError> {
  7. let blahaj = "
  8. ((/
  9. ,(((/
  10. /((((( (/
  11. ((((#(( (//
  12. (((((((. *(((/
  13. /(######/ *((((/
  14. *//%#####((/ ((#((/
  15. ,*/********/////////////////(//* (%* ,((##((
  16. ,*/((///(//////////((/(///////(/////(////*,(*#((/(/((//////###(###(/(
  17. /(((((((//((///((////((((((/(((((((((((((((((/(((##((#%(##(/((///*(&#(##/
  18. /#((%(#(((((//#((((((((((((((((((((((((#(((((((((((/##(((((//((//* ####(/
  19. (((###(###(#(#####(###############((#((((((((/((//(((#/(///// ,,
  20. ,(###%####%&%#############(#(#(####(((((((/(((/////*//,
  21. . .....*#(#######(((###(#(##(##(((/(/(/////,
  22. .. ....,..........,..*#%#######/(
  23. .. .............,*%%%%#%((((/
  24. **,,,****//*(##((###(#(((
  25. &#(#/#((((((((#";
  26. if args.is_empty() {
  27. println!("{}", blahaj);
  28. } else {
  29. if args[0].eq("-t") {
  30. trans_flag(blahaj);
  31. }
  32. }
  33. Ok(())
  34. }
  35. }
  36. fn trans_flag(blahaj: &str) {
  37. for (index, lines) in blahaj.lines().enumerate() {
  38. if index % 4 == 0 {
  39. println!("{}", lines.truecolor(91, 206, 250));
  40. } else if index % 2 == 0 {
  41. println!("{}", lines.white());
  42. } else { println!("{}", lines.truecolor(245, 169, 184)); }
  43. }
  44. }