From 4117e8dc142a81e7f77d5367c83e0cfc411d1664 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Mon, 12 Jul 2010 16:57:32 +0200 Subject: [PATCH] [Aggregator] Add -h option --- infrastructure-centred/owlps-aggregator/owlps-aggregator.h | 2 +- infrastructure-centred/owlps-aggregator/owlps-aggregatord.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/infrastructure-centred/owlps-aggregator/owlps-aggregator.h b/infrastructure-centred/owlps-aggregator/owlps-aggregator.h index 84f7155..235b591 100644 --- a/infrastructure-centred/owlps-aggregator/owlps-aggregator.h +++ b/infrastructure-centred/owlps-aggregator/owlps-aggregator.h @@ -15,7 +15,7 @@ /* Arguments & program configuration */ -#define OPTIONS "a:c:f:i:k:l:o:p:" // getopt string +#define OPTIONS "a:c:f:hi:k:l:o:p:" // getopt string #define DEFAULT_CONFIG_FILE "/usr/local/etc/owlps/owlps-aggregator.conf" #define DEFAULT_AGGREGATE_TIMEOUT 1500 // milliseconds #define DEFAULT_KEEP_TIMEOUT 3000 // milliseconds diff --git a/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c b/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c index 73f67f6..20b0ac6 100644 --- a/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c +++ b/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c @@ -142,6 +142,9 @@ void parse_command_line(int argc, char **argv) break ; case 'f' : // Config file break ; // (already parsed) + case 'h' : + print_usage() ; + exit(0) ; case 'i' : cfg_setstr(cfg, "positioner_ip", optarg) ; break ; @@ -686,6 +689,7 @@ void print_usage() " [-c check_interval] [-o output_file]\n" "Main options:\n" + "\t-h\t\tPrint this help.\n" "\t-f config_file\tUse 'config_file' instead of the default" " configuration file.\n"