From 6761650648311cd38e287cd3392838c49537a48c Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Wed, 12 Jun 2013 14:34:39 -0400 Subject: [PATCH] [Aggregator] Make -o optional The -o parameter is now optional, and the default output file is the standard output. --- TODO.t2t | 2 -- owlps-aggregator/owlps-aggregatord.c | 16 +++++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/TODO.t2t b/TODO.t2t index 6002ee3..2da8ba3 100644 --- a/TODO.t2t +++ b/TODO.t2t @@ -89,8 +89,6 @@ Work to do in OwlPS - Test for the maximum verbose level. -- -o should be optional. - - Add an option to (not) flush the output file. - Outputs should include all the timestamps diff --git a/owlps-aggregator/owlps-aggregatord.c b/owlps-aggregator/owlps-aggregatord.c index 86b8086..a8462d3 100644 --- a/owlps-aggregator/owlps-aggregatord.c +++ b/owlps-aggregator/owlps-aggregatord.c @@ -252,7 +252,8 @@ int parse_config_file(int argc, char **argv) CFG_INT("positioner_port", OWL_DEFAULT_AGGREGATION_PORT, CFGF_NONE), CFG_STR("positioner_ip", POSITIONER_DEFAULT_IP, CFGF_NONE), - CFG_STR("output_file", "", CFGF_NONE), + // Output file (default is the standard output) + CFG_STR("output_file", "-", CFGF_NONE), // Timeouts (in milliseconds): CFG_INT("aggregate_timeout", DEFAULT_AGGREGATE_TIMEOUT, CFGF_NONE), @@ -428,7 +429,8 @@ int check_configuration() // output_file // if (cfg_getstr(cfg, "output_file")[0] == '\0') { - fprintf(stderr, "Error! You must specify an output file.\n") ; + fprintf(stderr, + "Error! The empty string is not a valid output file.\n") ; print_usage() ; owl_run = false ; return OWL_ERR_BAD_USAGE ; @@ -1437,20 +1439,20 @@ void print_usage() " [-G]" " [-D]" " [-v[v[v[v]]] | -q]" - " -o out_file" "\n\t" + " [-o out_file]" " [-i positionner_ip]" " [-p positioner_port]" - " [-l listening_port]" "\n\t" + " [-l listening_port]" " [-t aggregate_timeout]" " [-k keep_timeout]" - " [-c check_interval]" "\n\t" + " [-c check_interval]" " [-A]" " [-a autocalibration_port]" - " [-K ap_keep_timeout]" "\n\t" + " [-K ap_keep_timeout]" " [-C ap_check_interval]" "\n" "\t%s -h\n" @@ -1474,7 +1476,7 @@ void print_usage() "Output options:\n" "\t-o out_file\t\tAggregated requests will be appended to" - " this CSV\n\t\t\t\tfile ('-' designates the standard" + " this CSV\n\t\t\t\tfile (default is \"-\", i.e. the standard" " output).\n" "\t-i positionner_ip\tIP address of the localisation server" " (default:\n\t\t\t\t%s).\n"