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.

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