From c213d434ecbde1f27b90cfa6334a3d33f1121c14 Mon Sep 17 00:00:00 2001 From: kevinnls <57634663+kevinnls@users.noreply.github.com> Date: Tue, 27 Apr 2021 20:05:49 +0530 Subject: [PATCH] patch: a temporary help prompt for `-h` to be improved --- src/main.c | 3 ++- src/tmp_help.h | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/tmp_help.h diff --git a/src/main.c b/src/main.c index f47f538..b285def 100644 --- a/src/main.c +++ b/src/main.c @@ -3,6 +3,7 @@ */ #include #include //remove if alt to `malloc` + clone found +#include "tmp_help.h" unsigned long int hash(){ //implement a hashing function @@ -28,7 +29,7 @@ char **argv; // ! use minimal # of functions to reduce stacks ! // void print_usage(){ - printf("HELP MENU PRINTED"); + tmp_help(); /*TODO: //print hex array included at ln1 // `stdouterr_1` is the *likely* name of the variable holding the hex diff --git a/src/tmp_help.h b/src/tmp_help.h new file mode 100644 index 0000000..b9438ba --- /dev/null +++ b/src/tmp_help.h @@ -0,0 +1,23 @@ +/* a temporary help prompt function + * that i do not like + * at all + */ +#define BOLD "\33[1m" +#define RESET "\33[0m" +#define embolden(str) BOLD str RESET + +void tmp_help(){ + printf("\n%s\n", embolden("stdouterr")); + printf("%s\n", embolden("Usage")); + printf(" %s\n", "stdouterr [ -o output_string | -t ] [ -e error_string | -r ]"); + printf("\n%s\n", embolden("Options")); + printf("\ + -o output_string\n\ + Print output_string to stdout\n\ + -e error_string\n\ + Print error_string to stderr\n\ + -t\n\ + Don\'t print output\n\ + -r\n\ + Don\'t print error"); +}