diff options
| author | Paul Buetow <paul@buetow.org> | 2021-10-15 09:04:40 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-10-15 09:04:40 +0300 |
| commit | c0332e8fa13f4939de17c856b2e71fd093847253 (patch) | |
| tree | dbeb9c7f5f6ea99f0bb2afa806403f6a375c0db0 /cmd | |
| parent | 698fb76b98c46c677abe13fdc93afc6c4f38c39e (diff) | |
add dcat color output test
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/dcat/main.go | 3 | ||||
| -rw-r--r-- | cmd/dgrep/main.go | 3 | ||||
| -rw-r--r-- | cmd/dmap/main.go | 3 | ||||
| -rw-r--r-- | cmd/dtail/main.go | 5 | ||||
| -rw-r--r-- | cmd/dtailhealth/main.go | 7 |
5 files changed, 8 insertions, 13 deletions
diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go index 5851acc..5e35d6f 100644 --- a/cmd/dcat/main.go +++ b/cmd/dcat/main.go @@ -53,9 +53,6 @@ func main() { if displayVersion { version.PrintAndExit() } - if !args.Spartan { - version.Print() - } ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup diff --git a/cmd/dgrep/main.go b/cmd/dgrep/main.go index 3cbb3cc..602d318 100644 --- a/cmd/dgrep/main.go +++ b/cmd/dgrep/main.go @@ -59,9 +59,6 @@ func main() { if displayVersion { version.PrintAndExit() } - if !args.Spartan { - version.Print() - } ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup diff --git a/cmd/dmap/main.go b/cmd/dmap/main.go index 89ca5d0..7591c6c 100644 --- a/cmd/dmap/main.go +++ b/cmd/dmap/main.go @@ -50,9 +50,6 @@ func main() { if displayVersion { version.PrintAndExit() } - if !args.Spartan { - version.Print() - } ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup diff --git a/cmd/dtail/main.go b/cmd/dtail/main.go index ee019ae..54800b6 100644 --- a/cmd/dtail/main.go +++ b/cmd/dtail/main.go @@ -81,9 +81,6 @@ func main() { if displayColorTable { color.TablePrintAndExit(false) } - if !checkHealth { - version.Print() - } } ctx, cancel := context.WithCancel(context.Background()) @@ -98,7 +95,7 @@ func main() { dlog.Start(ctx, &wg, source.Client) if checkHealth { - fmt.Println("WARN: DTail health check has moved to separate binary dtailhealtcheck" + + fmt.Println("WARN: DTail health check has moved to separate binary dtailhealth" + " - please adjust the monitoring scripts!") cancel() os.Exit(1) diff --git a/cmd/dtailhealth/main.go b/cmd/dtailhealth/main.go index 7e54b1c..ec97d3a 100644 --- a/cmd/dtailhealth/main.go +++ b/cmd/dtailhealth/main.go @@ -16,19 +16,26 @@ import ( "github.com/mimecast/dtail/internal/io/dlog" "github.com/mimecast/dtail/internal/io/signal" "github.com/mimecast/dtail/internal/source" + "github.com/mimecast/dtail/internal/version" ) // The evil begins here. func main() { var args config.Args + var displayVersion bool var pprof int + flag.BoolVar(&displayVersion, "version", false, "Display version") flag.IntVar(&pprof, "pprof", -1, "Start PProf server this port") flag.StringVar(&args.Logger, "logger", config.DefaultHealthCheckLogger, "Logger name") flag.StringVar(&args.LogLevel, "logLevel", "none", "Log level") flag.StringVar(&args.ServersStr, "server", "", "Remote server to connect") flag.Parse() + if displayVersion { + version.PrintAndExit() + } + config.Setup(source.HealthCheck, &args, flag.Args()) ctx, cancel := context.WithCancel(context.Background()) |
