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.

70 lines
2.7 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. } else if args[0].eq("-p") {
  32. pride_flag(blahaj);
  33. }
  34. }
  35. Ok(())
  36. }
  37. }
  38. fn trans_flag(blahaj: &str) {
  39. for (index, lines) in blahaj.lines().enumerate() {
  40. if index % 4 == 0 {
  41. println!("{}", lines.truecolor(91, 206, 250));//light blue
  42. } else if index % 2 == 0 {
  43. println!("{}", lines.white());
  44. } else { println!("{}", lines.truecolor(245, 169, 184)); }//pink
  45. }
  46. }
  47. fn pride_flag(blahaj: &str) {
  48. let mut index = 1;
  49. for lines in blahaj.lines() {
  50. if index == 6 {
  51. println!("{}", lines.truecolor(36, 84, 142));//blue
  52. index = 0;
  53. } else if index == 5 {
  54. println!("{}", lines.truecolor(0, 178, 38));//green
  55. } else if index == 4 {
  56. println!("{}", lines.truecolor(255, 237, 0));//yellow
  57. } else if index == 3 {
  58. println!("{}", lines.truecolor(255, 140, 0));//orange
  59. } else if index == 2 {
  60. println!("{}", lines.truecolor(228, 3, 3));//red
  61. } else {
  62. println!("{}", lines.truecolor(115, 41, 130));//violet
  63. }
  64. index = index + 1;
  65. }
  66. }