From: Florian Forster Date: Thu, 18 Aug 2016 04:58:53 +0000 (+0200) Subject: Merge branch 'pr/6' X-Git-Url: https://git.octo.it/?p=liboping.git;a=commitdiff_plain;h=0e8b1b239fdcf9307a14d57c1620843e86932583;hp=-c Merge branch 'pr/6' --- 0e8b1b239fdcf9307a14d57c1620843e86932583 diff --combined src/oping.c index 883c862,0ec6794..0cfe646 --- a/src/oping.c +++ b/src/oping.c @@@ -209,6 -209,7 +209,7 @@@ static int opt_show_graph = 1 static int opt_utf8 = 0; #endif static char *opt_outfile = NULL; + static int opt_bell = 0; static int host_num = 0; static FILE *outfile = NULL; @@@ -652,7 -653,7 +653,7 @@@ static int read_options (int argc, cha while (1) { - optchar = getopt (argc, argv, "46c:hi:I:t:Q:f:D:Z:O:P:m:w:" + optchar = getopt (argc, argv, "46c:hi:I:t:Q:f:D:Z:O:P:m:w:b" #if USE_NCURSES "uUg:" #endif @@@ -754,7 -755,6 +755,7 @@@ free (opt_outfile); opt_outfile = strdup (optarg); } + break; case 'P': { @@@ -791,6 -791,9 +792,9 @@@ opt_utf8 = 1; break; #endif + case 'b': + opt_bell = 1; + break; case 'Z': { @@@ -1576,6 -1579,13 +1580,13 @@@ static void update_host_hook (pingobj_i #if USE_NCURSES } #endif + if (opt_bell) { + #if USE_NCURSES + beep(); + #else + HOST_PRINTF ("\a"); + #endif + } } else /* if (!(latency > 0.0)) */ {