From dc4a93b34ab91ee67dde95fe8c251009db51c5c9 Mon Sep 17 00:00:00 2001
From: Joel Grunbaum <joelgrun@gmail.com>
Date: Wed, 21 Oct 2020 13:35:09 +0000
Subject: [PATCH] Added GPLv3 license

---
 main.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/main.c b/main.c
index 5fb4cf2..edcc99d 100644
--- a/main.c
+++ b/main.c
@@ -30,13 +30,13 @@
 int main(int argc, char** argv)
 {
 	int option, added_hosts = 0;
-	while((option = getopt(argc, argv, "s:h:t:n:")) != -1) {
+	while((option = getopt(argc, argv, "s:a:t:n:h")) != -1) {
 		switch (option) {
 		case 's': //server to use
 			add_dns_server(&servers, optarg);
 			num_servers++;
 			break;
-		case 'h': //hostname to search
+		case 'a': //hostname to search
 			add_hosts_server(&hosts, optarg);
 			added_hosts++;
 			break;
@@ -47,8 +47,15 @@
 			num_tests = atoi(optarg);
 			break;
 		case '?':
+		case 'h':
 		default:
-			printf("Error: invalid option -%c\n", optopt);
+			printf("Usage: %s [options]\n", argv[0]);
+			printf("Options:\n");
+			printf("\t-s <server>\tadd a DNS server to be tested\n");
+			printf("\t-a <hostname>\tadd a hostname to be tested\n");
+			printf("\t-t <number>\tspecify the number of hostnames to be tested, capped at 50 + number manually added\n\t\t\tdefaults to test all available\n");
+			printf("\t-n <number>\tspecify the number of tests to perform on each hostname\n\t\t\tdefaults to 10\n");
+			printf("\t-h\t\tShow this help\n");
 			free_dns_list(&servers);
 			free_hosts_list(&hosts);
 			exit(1);

--
Gitblit v1.10.0