From aa7697833e56a3bfb872eac029260dddea9b68c4 Mon Sep 17 00:00:00 2001 From: jaketothepast Date: Sat, 23 Feb 2019 19:33:54 -0500 Subject: [PATCH] Add a usage function --- main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.c b/main.c index 07df040..0e1f551 100644 --- a/main.c +++ b/main.c @@ -35,6 +35,12 @@ void blockHost(FILE *hostsFile, char *host) fputs(blockRule, hostsFile); } +void usage() +{ + fprintf(stdout, "Usage: "); + fprintf(stdout, "hb [add] \n"); +} + /** * Entrypoint. */ @@ -58,6 +64,11 @@ int main(int argc, char **argv) { fprintf(stdout, "Soon to be implemented!\n"); } + else if (strcmp(argv[i], "-h") == 0) + { + usage(); + exit(0); + } } if (hostsFile != NULL)