Option ['t'][] (ReqArg set_to "email_address") "Send tweets TO email_address.",
Option ['f'][] (ReqArg set_from "email_address") "Send tweets FROM email_address."
]
-
+
set_help :: Options -> IO Options
set_help opts = do
set_from :: String -> Options -> IO Options
set_from arg opts = do
return opts { opt_from = Just arg }
-
+
-- The usage header.
usage :: String
parse_errors :: IO [String]
parse_errors = do
argv <- getArgs
- let (_, _, errors) = getOpt Permute options argv
+ let (_, _, errors) = getOpt Permute options argv
errs_username <- username_errors
errs_to <- to_errors
errs_from <- from_errors
opts <- parse_options
return (opt_from opts)
-
+
parse_usernames :: IO [String]
parse_usernames = do
argv <- getArgs