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.

90 lines
3.3 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. } else if args[0].eq("-ger") {
  34. german(blahaj);
  35. } else {
  36. println!("{} is not a valid style for blahaj", args[0])
  37. }
  38. }
  39. Ok(())
  40. }
  41. }
  42. fn trans_flag(blahaj: &str) {
  43. for (index, lines) in blahaj.lines().enumerate() {
  44. if index % 4 == 0 {
  45. println!("{}", lines.truecolor(91, 206, 250));//light blue
  46. } else if index % 2 == 0 {
  47. println!("{}", lines.white());
  48. } else {
  49. println!("{}", lines.truecolor(245, 169, 184));//pink
  50. }
  51. }
  52. }
  53. fn pride_flag(blahaj: &str) {
  54. let mut index = 1;
  55. for lines in blahaj.lines() {
  56. if index == 6 {
  57. println!("{}", lines.truecolor(36, 84, 142));//blue
  58. index = 0;
  59. } else if index == 5 {
  60. println!("{}", lines.truecolor(0, 178, 38));//green
  61. } else if index == 4 {
  62. println!("{}", lines.truecolor(255, 237, 0));//yellow
  63. } else if index == 3 {
  64. println!("{}", lines.truecolor(255, 140, 0));//orange
  65. } else if index == 2 {
  66. println!("{}", lines.truecolor(228, 3, 3));//red
  67. } else {
  68. println!("{}", lines.truecolor(115, 41, 130));//violet
  69. }
  70. index = index + 1;
  71. }
  72. }
  73. fn german(blahaj: &str) {
  74. for (index, lines) in blahaj.lines().enumerate() {
  75. if index <= 7 {
  76. println!("{}", lines.truecolor(30, 30, 30));//black
  77. } else if index > 6 && index <= 12 {
  78. println!("{}", lines.truecolor(255, 0, 0));//red
  79. } else {
  80. println!("{}", lines.truecolor(255, 255, 0));//yellow
  81. }
  82. }
  83. }