From b7ca669b3a11ad0a156c89ab35b88ab63f1861ff Mon Sep 17 00:00:00 2001 From: jaketothepast Date: Tue, 14 Jan 2020 14:37:12 -0500 Subject: [PATCH] Usage and docs update --- README.md | 4 ++++ main.c | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9c2840b..4d2d3d1 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ The Host Blocker command. This is a system utility written in C that allows one to quickly black hole hosts in the /etc/hosts file, keeping one from resolving any DNS for those hosts and permanently blocking them on the system. +# How it Works + +The program will wake up in a configurable timeframe continuously, reading a config file into memory and making appropriate changes to the /etc/hosts based on what it reads from the config. + # Motivations I would like to get better with C, and will be using C much more in the near future. In addition, I have issues with browsing to sites that hurt my productivity and am always on the command line. diff --git a/main.c b/main.c index 3553122..20feed2 100644 --- a/main.c +++ b/main.c @@ -63,14 +63,6 @@ void blockHost(char *host) fclose(hostsFile); } -void usage() -{ - fprintf(stdout, "Usage: "); - fprintf(stdout, "hb [add] \n"); - fprintf(stdout, "hb [edit] \n"); - fprintf(stdout, "hb [show]\n"); - fprintf(stdout, "hb [delete] \n"); -} void showHosts() { @@ -177,6 +169,16 @@ void run_loop() { } } +void usage() +{ + fprintf(stdout, "Usage: "); + fprintf(stdout, "hb [add] \n"); + fprintf(stdout, "hb [edit] \n"); + fprintf(stdout, "hb [show]\n"); + fprintf(stdout, "hb [delete] \n"); + fprintf(stdout, "hb -period -config -daemon\n"); +} + /** * Entrypoint. */