From e894b56205e522e2c8261849cc5e8dad106536f9 Mon Sep 17 00:00:00 2001 From: pancake Date: Thu, 1 Mar 2018 10:53:53 +0100 Subject: [PATCH] Add more clippies --- libr/core/cmd_help.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/libr/core/cmd_help.c b/libr/core/cmd_help.c index 8cf907873c..66e626160f 100644 --- a/libr/core/cmd_help.c +++ b/libr/core/cmd_help.c @@ -224,18 +224,41 @@ static char *filterFlags(RCore *core, const char *msg) { return buf; } -R_API void r_core_clippy(const char *msg) { - int msglen = strlen (msg); - char *l = strdup (r_str_pad ('-', msglen)); - char *s = strdup (r_str_pad (' ', msglen)); - r_cons_printf ( +static const char *getClippy() { + const int choose = r_num_rand (3); + switch (choose) { + case 0: return " .--. .-%s-.\n" " | _| | %s |\n" " | O O < %s |\n" " | | | | %s |\n" " || | / `-%s-'\n" " |`-'|\n" -" `---'\n", l, s, msg, s, l); +" `---'\n"; + case 1: return +" .--. .-%s-.\n" +" | __\\ | %s |\n" +" | > < < %s |\n" +" | \\| | %s |\n" +" |/_// `-%s-'\n" +" | / \n" +" `-'\n"; + case 2: return +" .--. .-%s-.\n" +" | _|_ | %s |\n" +" | O O < %s |\n" +" | || | %s |\n" +" | _:| `-%s-'\n" +" | |\n" +" `---'\n"; + } +} + +R_API void r_core_clippy(const char *msg) { + int msglen = strlen (msg); + char *l = strdup (r_str_pad ('-', msglen)); + char *s = strdup (r_str_pad (' ', msglen)); + r_cons_printf (getClippy(), l, s, msg, s, l); free (l); free (s); }