|
@@ -77,7 +77,7 @@ static void LOG_func(const char *msg) {
|
77
|
77
|
LOG(msg);
|
78
|
78
|
}
|
79
|
79
|
|
80
|
|
-static const char short_options[] = "i:d:N:Sl:L:F:I:1:RzM:T:W:O:o:t:rk:g:upwxyc:C:Y:Q:A:s:U:P:B:46eZ:Ef:a:X:vqH:G:2:KJ:D:jbhVn:m:";
|
|
80
|
+static const char short_options[] = "i:d:N:9Sl:L:F:I:1:RzM:T:W:O:o:t:rk:g:upwxyc:C:Y:Q:A:s:U:P:B:46eZ:Ef:a:X:vqH:G:2:KJ:D:jbhVn:m:";
|
81
|
81
|
|
82
|
82
|
// Unused short options: 035789
|
83
|
83
|
static const struct option long_options[] = {
|
|
@@ -88,6 +88,7 @@ static const struct option long_options[] = {
|
88
|
88
|
{ "syslog-port", required_argument, NULL, 'L' },
|
89
|
89
|
{ "log-file", required_argument, NULL, 'F' },
|
90
|
90
|
{ "notify-program", required_argument, NULL, 'N' },
|
|
91
|
+ { "notify-wait", no_argument, NULL, '9' },
|
91
|
92
|
|
92
|
93
|
{ "input", required_argument, NULL, 'I' },
|
93
|
94
|
{ "input-source", required_argument, NULL, '1' },
|
|
@@ -160,6 +161,8 @@ static void show_help(struct ts *ts) {
|
160
|
161
|
printf(" -i --ident <server> | Format PROVIDER/CHANNEL. Default: empty\n");
|
161
|
162
|
printf(" -d --daemon <pidfile> | Daemonize program and write pid file.\n");
|
162
|
163
|
printf(" -N --notify-program <prg> | Execute <prg> to report events. Default: empty\n");
|
|
164
|
+ printf(" -9 --notify-wait | Enable one by one notification delivery.\n");
|
|
165
|
+ printf(" . Default: not set (async, deliver ASAP)\n");
|
163
|
166
|
printf("\n");
|
164
|
167
|
printf("Input options:\n");
|
165
|
168
|
printf(" -I --input <source> | Where to read from. File or multicast address.\n");
|
|
@@ -314,7 +317,9 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
314
|
317
|
case 'N': // --notify-program
|
315
|
318
|
ts->notify_program = optarg;
|
316
|
319
|
break;
|
317
|
|
-
|
|
320
|
+ case '9': // --notify-wait
|
|
321
|
+ ts->notify_wait = !ts->notify_wait;
|
|
322
|
+ break;
|
318
|
323
|
case 'S': // --syslog
|
319
|
324
|
ts->syslog_active = 1;
|
320
|
325
|
ts->syslog_remote = 0;
|
|
@@ -682,7 +687,7 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
682
|
687
|
if (ts->ident)
|
683
|
688
|
ts_LOGf("Ident : %s\n", ts->ident);
|
684
|
689
|
if (ts->notify_program)
|
685
|
|
- ts_LOGf("Notify prg : %s\n", ts->notify_program);
|
|
690
|
+ ts_LOGf("Notify prg : %s (%s)\n", ts->notify_program, ts->notify_wait ? "sync" : "async");
|
686
|
691
|
if (ts->pidfile)
|
687
|
692
|
ts_LOGf("Daemonize : %s pid file.\n", ts->pidfile);
|
688
|
693
|
if (ts->syslog_active) {
|