[Aggregator] Make -o optional

The -o parameter is now optional, and the default output file is the
standard output.
This commit is contained in:
Matteo Cypriani 2013-06-12 14:34:39 -04:00
parent a29a43a6fa
commit 6761650648
2 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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"