mirror of
https://github.com/kevinnlsamuel/stdouterr.git
synced 2025-12-06 09:55:58 +05:30
patch: a temporary help prompt for -h to be improved
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h> //remove if alt to `malloc` + clone found
|
#include <stdlib.h> //remove if alt to `malloc` + clone found
|
||||||
|
#include "tmp_help.h"
|
||||||
|
|
||||||
unsigned long int hash(){
|
unsigned long int hash(){
|
||||||
//implement a hashing function
|
//implement a hashing function
|
||||||
@@ -28,7 +29,7 @@ char **argv;
|
|||||||
// ! use minimal # of functions to reduce stacks ! //
|
// ! use minimal # of functions to reduce stacks ! //
|
||||||
|
|
||||||
void print_usage(){
|
void print_usage(){
|
||||||
printf("HELP MENU PRINTED");
|
tmp_help();
|
||||||
/*TODO:
|
/*TODO:
|
||||||
//print hex array included at ln1
|
//print hex array included at ln1
|
||||||
// `stdouterr_1` is the *likely* name of the variable holding the hex
|
// `stdouterr_1` is the *likely* name of the variable holding the hex
|
||||||
|
|||||||
23
src/tmp_help.h
Normal file
23
src/tmp_help.h
Normal 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");
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user