From 27a98ee4b3322c887c6b89aa2fefcb88c2541dc7 Mon Sep 17 00:00:00 2001 From: Paul ALNET Date: Thu, 7 Mar 2024 10:47:26 +0100 Subject: [PATCH] feat(v33): descriptive usage message --- tsock_v3.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tsock_v3.c b/tsock_v3.c index 8c4eb5b..fe7cb04 100644 --- a/tsock_v3.c +++ b/tsock_v3.c @@ -95,7 +95,7 @@ int main (int argc, char **argv) default: print_usage(); - break; + exit(1); } } @@ -358,5 +358,12 @@ int count_digits(int lg) { } void print_usage() { - printf("usage: cmd [-p|-s][-n ##]\n"); + printf("usage: tsock_v3 [-psu] [-n nb_messages] [-l mess_length] [host] \n"); + printf("parameters: host With -s, address of the host to connect to. Required with -s.\n"); + printf(" port Port to connect or bind to. Required.\n"); + printf("options: -l mess_length Size of the messages to send. Min 5. Max 1400. Default 30. Ignored with -p.\n"); + printf(" -n nb_messages Number of messages to send. Min 1. Default 10. Ignored with -p.\n"); + printf(" -p Runs a TCP/UDP sink. Incompatible with -s.\n"); + printf(" -s Runs a TCP/UDP faucet. Incompatible with -p.\n"); + printf(" -u Use UDP instead of TCP.\n"); }