summaryrefslogtreecommitdiffstats
path: root/cmd/email.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/email.go')
-rw-r--r--cmd/email.go24
1 files changed, 11 insertions, 13 deletions
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())
+ })
}