Skip to content

Commit

Permalink
Add --hide-errors arg
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Sheiko committed Aug 3, 2022
1 parent 17228d5 commit f353c51
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Options:
--all, -a Scan all providers
--count COUNT, -c COUNT
Number of pings to send [default: 4]
--hide-errors, -e Hide errors from results
--region REGION, -r REGION
Filter by regions, can be specified multiple times
--location LOCATION, -l LOCATION
Expand Down
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
type config struct {
All bool `arg:"--all,-a" help:"Scan all providers"`
Count int `arg:"--count,-c" default:"4" help:"Number of pings to send"`
HideErrors bool `arg:"--hide-errors,-e" help:"Hide errors from results"`
FilterRegion []string `arg:"--region,-r,separate" help:"Filter by regions, can be specified multiple times"`
FilterLocation []string `arg:"--location,-l,separate" help:"Filter by location, can be specified multiple times"`
Provider string `arg:"--provider,-p" default:"aws" help:"Choose provider for ping"`
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ func main() {
for _, region := range results {
status := "OK"
if region.err != nil {
if args.HideErrors {
continue
}
status = fmt.Sprintf("ERROR: %s", region.err)
} else if region.rtt == 0 {
continue
Expand Down

0 comments on commit f353c51

Please sign in to comment.