X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCommandLine.hs;h=405ded8ef9597cb181e986b4d31240a6594a9e9e;hb=eae92cebe7fab4afc5c7de377ec30ec348ef09ad;hp=1088f2a906a2d2055143f1c0b2036f039fb0155c;hpb=a6d2e7470f17b44c0e8fe31c1268488a6788631f;p=email-validator.git diff --git a/src/CommandLine.hs b/src/CommandLine.hs index 1088f2a..405ded8 100644 --- a/src/CommandLine.hs +++ b/src/CommandLine.hs @@ -17,8 +17,10 @@ import ExitCodes -- We optionally accept input/output files to use instead of -- stdin/stdout. -data Args = Args { input_file :: Maybe FilePath, - output_file :: Maybe FilePath } +data Args = Args { accept_a :: Bool, + input_file :: Maybe FilePath, + output_file :: Maybe FilePath, + rfc5322 :: Bool } deriving (Show, Data, Typeable) description :: String @@ -30,6 +32,10 @@ program_name = "email-validator" my_summary :: String my_summary = program_name ++ "-" ++ (showVersion version) +accept_a_help :: String +accept_a_help = + "Accept an 'A' record for the domain instead of requiring an MX record." + input_file_help :: String input_file_help = "Path to the input file (default: stdin), one email address per line" @@ -38,11 +44,17 @@ output_file_help :: String output_file_help = "Path to the output file (default: stdout)" +rfc5322_help :: String +rfc5322_help = + "Validate according to RFC 5322 (incredibly lenient)." + arg_spec :: Mode (CmdArgs Args) arg_spec = cmdArgsMode $ - Args { input_file = def &= typFile &= help input_file_help, - output_file = def &= typFile &= help output_file_help } + Args { accept_a = def &= help accept_a_help, + input_file = def &= typFile &= help input_file_help, + output_file = def &= typFile &= help output_file_help, + rfc5322 = def &= help rfc5322_help } &= program program_name &= summary my_summary &= details [description]