diff options
Diffstat (limited to 'networking/ping.c')
-rw-r--r-- | networking/ping.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/networking/ping.c b/networking/ping.c index 2e8bef023..7460e4414 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -340,7 +340,8 @@ static int common_ping_main(sa_family_t af, char **argv) | |||
340 | 340 | ||
341 | /* Full(er) version */ | 341 | /* Full(er) version */ |
342 | 342 | ||
343 | #define OPT_STRING ("qvc:+s:t:+w:+W:+I:np:4" IF_PING6("6")) | 343 | /* -c NUM, -t NUM, -w NUM, -W NUM */ |
344 | #define OPT_STRING "qvc:+s:t:+w:+W:+I:np:4"IF_PING6("6") | ||
344 | enum { | 345 | enum { |
345 | OPT_QUIET = 1 << 0, | 346 | OPT_QUIET = 1 << 0, |
346 | OPT_VERBOSE = 1 << 1, | 347 | OPT_VERBOSE = 1 << 1, |
@@ -863,9 +864,12 @@ static int common_ping_main(int opt, char **argv) | |||
863 | 864 | ||
864 | INIT_G(); | 865 | INIT_G(); |
865 | 866 | ||
866 | /* exactly one argument needed; -v and -q don't mix; -c NUM, -t NUM, -w NUM, -W NUM */ | 867 | opt |= getopt32(argv, "^" |
867 | opt_complementary = "=1:q--v:v--q"; | 868 | OPT_STRING |
868 | opt |= getopt32(argv, OPT_STRING, &pingcount, &str_s, &opt_ttl, &deadline, &timeout, &str_I, &str_p); | 869 | /* exactly one arg; -v and -q don't mix */ |
870 | "\0" "=1:q--v:v--q", | ||
871 | &pingcount, &str_s, &opt_ttl, &deadline, &timeout, &str_I, &str_p | ||
872 | ); | ||
869 | if (opt & OPT_s) | 873 | if (opt & OPT_s) |
870 | datalen = xatou16(str_s); // -s | 874 | datalen = xatou16(str_s); // -s |
871 | if (opt & OPT_I) { // -I | 875 | if (opt & OPT_I) { // -I |