patch: a temporary help prompt for -h to be improved

This commit is contained in:
kevinnls
2021-04-27 20:05:49 +05:30
parent 021e6372d1
commit c213d434ec
2 changed files with 25 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
*/
#include <stdio.h>
#include <stdlib.h> //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

23
src/tmp_help.h Normal file
View File

@@ -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");
}