From ca7b11ca964eb6b5c53920c205ae71a6897d0c50 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Fri, 13 Jun 2025 12:21:48 -0400 Subject: [PATCH] Print a friendlier error message if -batch_size specified --- cmd/certspotter/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/certspotter/main.go b/cmd/certspotter/main.go index bc61808..eb9af34 100644 --- a/cmd/certspotter/main.go +++ b/cmd/certspotter/main.go @@ -161,6 +161,7 @@ func main() { loglist.UserAgent = fmt.Sprintf("certspotter/%s (%s; %s; %s)", certspotterVersion(), runtime.Version(), runtime.GOOS, runtime.GOARCH) var flags struct { + batchSize bool email []string healthcheck time.Duration logs string @@ -173,6 +174,7 @@ func main() { version bool watchlist string } + flag.Func("batch_size", "Obsolete; do not use", func(string) error { flags.batchSize = true; return nil }) // TODO: remove in 0.21.0 flag.Func("email", "Email address to contact when matching certificate is discovered (repeatable)", appendFunc(&flags.email)) flag.DurationVar(&flags.healthcheck, "healthcheck", 24*time.Hour, "How frequently to perform a health check") flag.StringVar(&flags.logs, "logs", defaultLogList, "File path or URL of JSON list of logs to monitor") @@ -186,6 +188,10 @@ func main() { flag.StringVar(&flags.watchlist, "watchlist", defaultWatchListPathIfExists(), "File containing domain names to watch") flag.Parse() + if flags.batchSize { + fmt.Fprintf(os.Stderr, "%s: -batch_size is obsolete; please remove it from your command line\n", programName) + os.Exit(2) + } if flags.version { fmt.Fprintf(os.Stdout, "certspotter version %s\n", certspotterVersion()) os.Exit(0)