1 {-# LANGUAGE DeriveDataTypeable #-}
8 import System.Console.CmdArgs (
19 -- Get the version from Cabal.
20 import Paths_email_validator ( version )
21 import Data.Version ( showVersion )
24 data Args = Args { accept_a :: Bool,
29 description = "Perform naive validation of email addresses."
31 program_name :: String
32 program_name = "email-validator"
35 my_summary = program_name ++ "-" ++ (showVersion version)
37 accept_a_help :: String
39 "Accept an 'A' record for the domain instead of requiring an MX record."
41 rfc5322_help :: String
43 "Validate according to RFC 5322 (incredibly lenient)."
47 Args { accept_a = def &= help accept_a_help,
48 rfc5322 = def &= help rfc5322_help }
49 &= program program_name
51 &= details [description]
56 get_args = cmdArgs arg_spec