diff --git a/xkcp_spy.c b/xkcp_spy.c index 4465423..2f2bfdd 100644 --- a/xkcp_spy.c +++ b/xkcp_spy.c @@ -81,9 +81,11 @@ int main(int argc, char **argv) struct event_base *base; struct bufferevent *bev; char *cmd = NULL, *addr = NULL, *param = NULL; - int port = 0, opt; + int port = 0, opt, flag = 1; while((opt = getopt(argc, argv, "h:p:t:m:")) != -1) { + flag = 0; + switch(opt) { case 'h': addr = strdup(optarg); @@ -103,6 +105,11 @@ int main(int argc, char **argv) } } + if (flag) { + usage(); + exit(EXIT_FAILURE); + } + base = event_base_new(); if (!base) { puts("Couldn't open event base");