X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Foping.c;h=a19c42064b3a22758263cfa3ba2724db48507d0c;hb=564bf1c1751ffca23848510a8a9559a14b9559ee;hp=eb16469fb0b4c2043b39383e2edd896d94594c05;hpb=000eb200d0863e81e34dd19aa44103f2b44c4abe;p=liboping.git diff --git a/src/oping.c b/src/oping.c index eb16469..a19c420 100644 --- a/src/oping.c +++ b/src/oping.c @@ -155,7 +155,9 @@ static char *opt_filename = NULL; static int opt_count = -1; static int opt_send_ttl = 64; static uint8_t opt_send_qos = 0; +#if USE_NCURSES static int opt_utf8 = 0; +#endif static int host_num = 0; @@ -300,6 +302,9 @@ static void usage_exit (const char *name, int status) /* {{{ */ " -I srcaddr source address\n" " -D device outgoing interface name\n" " -f filename filename to read hosts from\n" +#if USE_NCURSES + " -u / -U force / disable UTF-8 output\n" +#endif "\noping "PACKAGE_VERSION", http://verplant.org/liboping/\n" "by Florian octo Forster \n" @@ -502,7 +507,11 @@ static int read_options (int argc, char **argv) /* {{{ */ while (1) { - optchar = getopt (argc, argv, "46uUc:hi:I:t:Q:f:D:"); + optchar = getopt (argc, argv, "46c:hi:I:t:Q:f:D:" +#if USE_NCURSES + "uU" +#endif + ); if (optchar == -1) break; @@ -514,13 +523,6 @@ static int read_options (int argc, char **argv) /* {{{ */ opt_addrfamily = (optchar == '4') ? AF_INET : AF_INET6; break; - case 'u': - opt_utf8 = 2; - break; - case 'U': - opt_utf8 = 1; - break; - case 'c': { int new_count; @@ -580,6 +582,15 @@ static int read_options (int argc, char **argv) /* {{{ */ set_opt_send_qos (optarg); break; +#if USE_NCURSES + case 'u': + opt_utf8 = 2; + break; + case 'U': + opt_utf8 = 1; + break; +#endif + case 'h': usage_exit (argv[0], 0); break;