From 69f11b104d7f99cdf44bac4d83f1dc4444291548 Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Tue, 30 Oct 2018 20:15:35 +0100 Subject: [PATCH] rename --min_reachable again to --reachable, and update changelog --- CHANGELOG.md | 5 +++++ doc/fping.pod | 5 +++-- src/fping.c | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bf8429..9053a6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ fping 4.2 (UNRELEASED) ====================== +## New features + +- New option -x / --reachable to check if the number of reachable hosts is >= a certain + number. Useful for example to implement connectivity-checks (#138, thanks @deepak0004) + ## Bugfixes and other changes - Fix build with --disable-ipv6 (#134, thanks @Polynomial-C) diff --git a/doc/fping.pod b/doc/fping.pod index 2805837..13f2424 100644 --- a/doc/fping.pod +++ b/doc/fping.pod @@ -225,9 +225,10 @@ Show targets that are unreachable. Print B version information. -=item B<-x>, B<--min_reachable>=I +=item B<-x>, B<--reachable>=I -Given a list of hosts, this mode prints if number of active hosts>=N or not. +Given a list of hosts, this mode checks if number of reachable hosts is >= N +and exits true in that case. =back diff --git a/src/fping.c b/src/fping.c index 5454516..6260c73 100644 --- a/src/fping.c +++ b/src/fping.c @@ -419,7 +419,7 @@ int main(int argc, char** argv) { NULL, 'T', OPTPARSE_REQUIRED }, { "unreach", 'u', OPTPARSE_NONE }, { "version", 'v', OPTPARSE_NONE }, - { "min_reachable", 'x', OPTPARSE_REQUIRED }, + { "reachable", 'x', OPTPARSE_REQUIRED }, { 0, 0, 0 } }; @@ -2788,6 +2788,6 @@ void usage(int is_error) fprintf(out, " -s, --stats print final stats\n"); fprintf(out, " -u, --unreach show targets that are unreachable\n"); fprintf(out, " -v, --version show version\n"); - fprintf(out, " -x, --min_reachable=N shows if >=N hosts are reachable or not\n"); + fprintf(out, " -x, --reachable=N shows if >=N hosts are reachable or not\n"); exit(is_error); -} \ No newline at end of file +}