Add a usage function

This commit is contained in:
Jacob Windle 2019-02-23 19:33:54 -05:00
parent 7d38e2bf78
commit aa7697833e

11
main.c
View File

@ -35,6 +35,12 @@ void blockHost(FILE *hostsFile, char *host)
fputs(blockRule, hostsFile); fputs(blockRule, hostsFile);
} }
void usage()
{
fprintf(stdout, "Usage: ");
fprintf(stdout, "hb [add] <sitename>\n");
}
/** /**
* Entrypoint. * Entrypoint.
*/ */
@ -58,6 +64,11 @@ int main(int argc, char **argv)
{ {
fprintf(stdout, "Soon to be implemented!\n"); fprintf(stdout, "Soon to be implemented!\n");
} }
else if (strcmp(argv[i], "-h") == 0)
{
usage();
exit(0);
}
} }
if (hostsFile != NULL) if (hostsFile != NULL)