From a5f907854f29e1c267ad30d1dfe85c2c47f5ac48 Mon Sep 17 00:00:00 2001 From: sinner Date: Wed, 15 Apr 2026 15:16:02 -0400 Subject: feat: add stdin support and retry logic for all search commands --- cmd/email.go | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'cmd/email.go') diff --git a/cmd/email.go b/cmd/email.go index 85cc686..871c272 100644 --- a/cmd/email.go +++ b/cmd/email.go @@ -17,7 +17,7 @@ var verifyEmailCmd = &cobra.Command{ Aliases: []string{"v"}, Short: "Verify email address", Long: `Performs comprehensive email verification including format validation, MX records check, SMTP verification, and disposable/webmail detection`, - Args: cobra.ExactArgs(1), + Args: argsOrStdin(1), RunE: runVerifyEmail, } @@ -27,21 +27,19 @@ func init() { } func runVerifyEmail(cmd *cobra.Command, args []string) error { - email := args[0] - c, err := newClient() if err != nil { return err } - response, err := c.VerifyEmail(email) - if err != nil { - return err - } - - if err := checkError(response.Error); err != nil { - return err - } - - return formatter.FormatEmailResults(response, IsJSONOutput()) + return forEachQuery(args, func(email string) error { + response, err := c.VerifyEmail(email) + if err != nil { + return err + } + if err := checkError(response.Error); err != nil { + return err + } + return formatter.FormatEmailResults(response, IsJSONOutput()) + }) } -- cgit v1.2.3