X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fhalcyon.git;a=blobdiff_plain;f=src%2FCommandLine.hs;h=919a3a2136f11a76a9da1441e36b7497084ad407;hp=15120439d40dd1ece0a933bc730b4cafa2e906ff;hb=4f4d9c4abf4f1711cd3d353e341ed5b71af14213;hpb=e5da9eeb1103fd4ba4f726e94617c139c873e7d8 diff --git a/src/CommandLine.hs b/src/CommandLine.hs index 1512043..919a3a2 100644 --- a/src/CommandLine.hs +++ b/src/CommandLine.hs @@ -5,6 +5,8 @@ module CommandLine ( heartbeat, help_set, help_text, + ignore_replies_set, + ignore_retweets_set, from_email_address, to_email_address, parse_errors, @@ -20,8 +22,8 @@ import System.Environment (getArgs) -- |A record containing values for all available options. data Options = Options { opt_heartbeat :: Maybe Int, opt_help :: Bool, - opt_ignore_retweets :: Bool, opt_ignore_replies :: Bool, + opt_ignore_retweets :: Bool, opt_from :: Maybe String, opt_to :: Maybe String } @@ -31,8 +33,8 @@ data Options = Options { opt_heartbeat :: Maybe Int, default_options :: Options default_options = Options { opt_heartbeat = Just 600, opt_help = False, - opt_ignore_retweets = False, opt_ignore_replies = False, + opt_ignore_retweets = False, opt_from = Nothing, opt_to = Nothing } @@ -68,13 +70,13 @@ options = "Send tweets FROM email_address.", Option - ['i']["ignore-retweets"] - (NoArg set_ignore_retweets) - "Ignore retweets.", + ['i']["ignore-replies"] + (NoArg set_ignore_replies) + "Ignore replies.", Option - ['I']["ignore-replies"] - (NoArg set_ignore_replies) + ['I']["ignore-retweets"] + (NoArg set_ignore_retweets) "Ignore retweets." ] @@ -203,6 +205,18 @@ help_set = do opts <- parse_options return (opt_help opts) +-- | Was the "ignore-replies" option passes on the command line? +ignore_replies_set :: IO Bool +ignore_replies_set = do + opts <- parse_options + return (opt_ignore_replies opts) + +-- | Was the "ignore-retweets" option passes on the command line? +ignore_retweets_set :: IO Bool +ignore_retweets_set = do + opts <- parse_options + return (opt_ignore_retweets opts) + -- |What's the heartbeat? heartbeat :: IO (Maybe Int) heartbeat = do