From 6ce8d695b05c4f24351c18110215a1c92d41c9f1 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Tue, 13 Jul 2010 17:02:48 +0200 Subject: [PATCH] [Client] Add -h option --- infrastructure-centred/owlps-client/owlps-client.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/infrastructure-centred/owlps-client/owlps-client.c b/infrastructure-centred/owlps-client/owlps-client.c index af8e55d..6ad0cbb 100644 --- a/infrastructure-centred/owlps-client/owlps-client.c +++ b/infrastructure-centred/owlps-client/owlps-client.c @@ -20,7 +20,7 @@ #define DEFAULT_DELAY_NORMAL 25000 // Localisation request /* Program arguments (getopt string) */ -#define OPTIONS "d:i:l::n:p:t:" +#define OPTIONS "d:hi:l::n:p:t:" /* Function headers */ @@ -229,6 +229,9 @@ void parse_main_options(int argc, char **argv) case 'd' : strncpy(options.dest_ip, optarg, 16) ; break ; + case 'h' : + print_usage() ; + exit(0) ; case 'i' : strncpy(options.iface, optarg, IFNAMSIZ + 1) ; break ; @@ -391,6 +394,7 @@ void print_usage() " direction x y z\n" "\n" "Options:\n" + "\t-h\t\tPrint this help.\n" "\t-d dest_ip\tDestination IP address of the localisation request.\n" "\t-p dest_port\tDestination port of the localisation request" " (default: %d).\n"