Add a usage function

pull/4/head
Jacob Windle 2019-02-23 19:33:54 -05:00
parent 7d38e2bf78
commit aa7697833e
1 changed files with 11 additions and 0 deletions

11
main.c
View File

@ -35,6 +35,12 @@ void blockHost(FILE *hostsFile, char *host)
fputs(blockRule, hostsFile);
}
void usage()
{
fprintf(stdout, "Usage: ");
fprintf(stdout, "hb [add] <sitename>\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)