[Aggregator] Add option -q (quiet mode)

This commit is contained in:
Matteo Cypriani 2011-07-23 22:53:31 +02:00
parent d6f337dbf2
commit 0f54bd36a3
2 changed files with 7 additions and 2 deletions

View File

@ -9,7 +9,7 @@
/* Arguments & program configuration */
#define OPTIONS "Aa:c:C:f:hi:k:K:l:o:p:t:vV" // getopt string
#define OPTIONS "Aa:c:C:f:hi:k:K:l:o:p:qt:vV" // 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

View File

@ -302,6 +302,10 @@ void parse_command_line(int argc, char **argv)
case 'p' :
cfg_setint(cfg, "positioner_port", strtol(optarg, NULL, 0)) ;
break ;
case 'q' :
// Quiet mode: reset the verbose level
cfg_setint(cfg, "verbose", 0) ;
break ;
case 't' :
cfg_setint(cfg, "aggregate_timeout", strtol(optarg, NULL, 0)) ;
break ;
@ -1264,7 +1268,7 @@ void print_usage()
printf("Usage:\n"
"\t%s"
" [-f config_file]"
" [-v[v[v[v]]]]"
" [-v[v[v[v]]] | -q]"
" -o output_file"
" [-i positionner_ip]"
" [-p positioner_port]"
@ -1289,6 +1293,7 @@ void print_usage()
" increase the level of verbosity (1 = warnings, 2 = useful"
" information, 3 = too much information, 4 = displays the"
" detail of each and every received request).\n"
"\t-q\t\tQuiet mode (default): sets the verbose level to 0.\n"
"Output options:\n"
"\t-o output_file\t\tAggregated requests will be appended to"