From: Michael Orlitzky Date: Mon, 15 Jul 2013 01:48:55 +0000 (-0400) Subject: Rewrite CommandLine to use cmdargs and integrate the command-line and RC file options. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=7bb00e04c15781d889f950d00babf3f183047bff;p=dead%2Fhalcyon.git Rewrite CommandLine to use cmdargs and integrate the command-line and RC file options. Clean up imports and dead code. --- diff --git a/src/CommandLine.hs b/src/CommandLine.hs index 878cd68..e70aa96 100644 --- a/src/CommandLine.hs +++ b/src/CommandLine.hs @@ -1,321 +1,149 @@ --- | The CommandLine module handles parsing of the command-line --- options. It should more or less be a black box, providing Main --- with only the information it requires. -module CommandLine -( get_cfg, - help_set, - help_text, - parse_errors, - parse_usernames -) where - -import Data.Maybe (fromJust, isJust, isNothing) -import System.Console.GetOpt -import System.Directory (doesFileExist) -import System.Environment (getArgs) - -import Configuration (Cfg(..)) - --- | A record containing values for all available options. -data Options = Options { opt_consumer_key :: Maybe String, - opt_consumer_secret :: Maybe String, - opt_access_token :: Maybe String, - opt_access_secret :: Maybe String, - opt_heartbeat :: Maybe Int, - opt_help :: Bool, - opt_ignore_replies :: Bool, - opt_ignore_retweets :: Bool, - opt_sendmail_path :: FilePath, - opt_from :: Maybe String, - opt_to :: Maybe String, - opt_verbose :: Bool } - - --- | Constructs an instance of Options, with each of its members set --- to default values. -default_options :: Options -default_options = Options { opt_access_token = Nothing, - opt_access_secret = Nothing, - opt_consumer_key = Nothing, - opt_consumer_secret = Nothing, - opt_heartbeat = Just 600, - opt_help = False, - opt_ignore_replies = False, - opt_ignore_retweets = False, - opt_sendmail_path = "/usr/sbin/sendmail", - opt_from = Nothing, - opt_to = Nothing, - opt_verbose = False } - - --- | The options list that we construct associates a function with --- each option. This function is responsible for updating an Options --- record with the appropriate value. --- --- For more information and an example of this idiom, see, --- --- --- -options :: [OptDescr (Options -> IO Options)] -options = - [ Option - "" ["consumer-key"] - (ReqArg set_consumer_key "consumer-key") - "Your Twitter API consumer key.", - - Option - "" ["consumer-secret"] - (ReqArg set_consumer_secret "consumer-secret") - "Your Twitter API consumer secret.", - - Option - "" ["access-token"] - (ReqArg set_access_token "access-token") - "Your Twitter API access token.", - - Option - "" ["access-secret"] - (ReqArg set_access_secret "access-secret") - "Your Twitter API access secret.", - - Option - "h" ["help"] - (NoArg set_help) - "Prints this help message.", - - Option - "n" ["heartbeat"] - (ReqArg set_heartbeat "heartbeat") - "How many seconds to wait between polling.", - - Option - "t" ["to"] - (ReqArg set_to "email_address") - "Send tweets TO email_address.", - - Option - "f" ["from"] - (ReqArg set_from "email_address") - "Send tweets FROM email_address.", - - Option - "s" ["sendmail-path"] - (ReqArg set_sendmail_path "sendmail-path") - "Use sendmail_path to send mail", - - Option - "i" ["ignore-replies"] - (NoArg set_ignore_replies) - "Ignore replies.", - - Option - "I" ["ignore-retweets"] - (NoArg set_ignore_retweets) - "Ignore retweets.", - - Option - "v" ["verbose"] - (NoArg set_verbose) - "Be verbose about stuff." - ] - - --- | Attempt to parse an 'Int' from a 'String'. This is just a 'Maybe' --- wrapper around 'reads'. -parse_int :: String -> Maybe Int -parse_int s = - case (reads s) of - [(n,_)] -> Just n - _ -> Nothing - -set_consumer_key :: String -> Options -> IO Options -set_consumer_key arg opts = - return opts { opt_consumer_key = Just arg } - -set_consumer_secret :: String -> Options -> IO Options -set_consumer_secret arg opts = - return opts { opt_consumer_secret = Just arg } - -set_access_token :: String -> Options -> IO Options -set_access_token arg opts = - return opts { opt_access_token = Just arg } - -set_access_secret :: String -> Options -> IO Options -set_access_secret arg opts = - return opts { opt_access_secret = Just arg } - -set_heartbeat :: String -> Options -> IO Options -set_heartbeat arg opts = do - let new_heartbeat = parse_int arg - return opts { opt_heartbeat = new_heartbeat } - -set_help :: Options -> IO Options -set_help opts = - return opts { opt_help = True } - -set_ignore_retweets :: Options -> IO Options -set_ignore_retweets opts = - return opts { opt_ignore_retweets = True } - -set_ignore_replies :: Options -> IO Options -set_ignore_replies opts = - return opts { opt_ignore_replies = True } - -set_verbose :: Options -> IO Options -set_verbose opts = - return opts { opt_verbose = True } - -set_sendmail_path :: String -> Options -> IO Options -set_sendmail_path arg opts = - return opts { opt_sendmail_path = arg } - -set_to :: String -> Options -> IO Options -set_to arg opts = - return opts { opt_to = Just arg } - -set_from :: String -> Options -> IO Options -set_from arg opts = - return opts { opt_from = Just arg } - - --- | The usage header. -usage :: String -usage = "Usage: twat --consumer-key= --consumer-secret= --access-token= --access-secret= [-n heartbeat] [-t to_address] [-f from_address] [-s path-to-sendmail] [username2, [username3]...]" - - --- | Was the help option passed? -help_set :: IO Bool -help_set = do - opts <- parse_options - return (opt_help opts) - --- | The usage header, and all available flags (as generated by GetOpt) -help_text :: String -help_text = usageInfo usage options - - --- | Return a list of options. -parse_options :: IO Options -parse_options = do - argv <- getArgs - let (actions, _, _) = getOpt Permute options argv - - -- This will execute each of the functions contained in our options - -- list, one after another, on a default_options record. The end - -- result should be an Options instance with all of its members set - -- correctly. - foldl (>>=) (return default_options) actions - - --- | A list of parse errors relating to the heartbeat. -heartbeat_errors :: IO [String] -heartbeat_errors = do - hb <- parse_heartbeat - return ["\"heartbeat\" does not appear to be an integer." | isNothing hb ] - --- | Parse errors relating to the list of usernames. -username_errors :: IO [String] -username_errors = do - argv <- getArgs - let (_, usernames, _) = getOpt Permute options argv - return [ "no usernames provided." | null usernames ] - - --- | Parse errors relating to the "To" address. -to_errors :: IO [String] -to_errors = do - toaddr <- parse_to_address - fromaddr <- parse_from_address - return ["\"from\" address specified without \"to\" address." - | (isNothing toaddr) && (isJust fromaddr) ] - - --- | Errors for the sendmail path argument. -sendmail_path_errors :: IO [String] -sendmail_path_errors = do - sendmail <- parse_sendmail_path - exists <- doesFileExist sendmail - return [ "sendmail path does not exist" | not exists ] - - --- | Parse errors relating to the "From" address. -from_errors :: IO [String] -from_errors = do - toaddr <- parse_to_address - fromaddr <- parse_from_address - return [ "\"to\" address specified without \"from\" address." - | (isJust toaddr) && (isNothing fromaddr) ] - - --- | Format an error message for printing. -format_error :: String -> String -format_error err = "ERROR: " ++ err ++ "\n" - - --- | Return a list of all parse errors. -parse_errors :: IO [String] -parse_errors = do - argv <- getArgs - let (_, _, errors) = getOpt Permute options argv - errs_heartbeat <- heartbeat_errors - errs_username <- username_errors - errs_to <- to_errors - errs_from <- from_errors - errs_sendmail <- sendmail_path_errors - return $ map format_error (errors ++ - errs_heartbeat ++ - errs_username ++ - errs_sendmail ++ - errs_to ++ - errs_from) - --- | What's the heartbeat? -parse_heartbeat :: IO (Maybe Int) -parse_heartbeat = do - opts <- parse_options - return (opt_heartbeat opts) - --- | What "To" address was given on the command line? -parse_to_address :: IO (Maybe String) -parse_to_address = do - opts <- parse_options - return (opt_to opts) - --- | What sendmail path was given on the command line? -parse_sendmail_path :: IO FilePath -parse_sendmail_path = do - opts <- parse_options - return (opt_sendmail_path opts) - --- | What "From" address was given on the command line? -parse_from_address :: IO (Maybe String) -parse_from_address = do - opts <- parse_options - return (opt_from opts) - - --- | What usernames were passed on the command line? -parse_usernames :: IO [String] -parse_usernames = do - argv <- getArgs - let (_, usernames, _) = getOpt Permute options argv - return usernames - - - --- | Construct a Cfg object from the command line options assuming --- there are no errors. -get_cfg :: IO Cfg -get_cfg = do - opts <- parse_options - return Cfg { consumer_key = fromJust $ opt_consumer_key opts, - consumer_secret = fromJust $ opt_consumer_secret opts, - access_token = fromJust $ opt_access_token opts, - access_secret = fromJust $ opt_access_secret opts, - heartbeat = fromJust $ opt_heartbeat opts, - ignore_replies = opt_ignore_replies opts, - ignore_retweets = opt_ignore_retweets opts, - sendmail_path = opt_sendmail_path opts, - from_address = opt_from opts, - to_address = opt_to opts, - verbose = opt_verbose opts } +module CommandLine ( + apply_args, + show_help + ) +where + +import System.Console.CmdArgs +import System.Console.CmdArgs.Explicit (process) +import System.Environment (getArgs, withArgs) +import System.Exit (ExitCode(..), exitWith) +import System.IO (hPutStrLn, stderr) + +-- Get the version from Cabal. +import Paths_twat (version) +import Data.Version (showVersion) + +import OptionalConfiguration +import ExitCodes + +description :: String +description = "Twat twats tweets so you don't have to twitter." + +program_name :: String +program_name = "twat" + +my_summary :: String +my_summary = program_name ++ "-" ++ (showVersion version) + +consumer_key_help :: String +consumer_key_help = "Your Twitter API consumer key" + +consumer_secret_help :: String +consumer_secret_help = "Your Twitter API consumer secret" + +access_token_help :: String +access_token_help = "Your Twitter API access token" + +access_secret_help :: String +access_secret_help = "Your Twitter API access secret" + +heartbeat_help :: String +heartbeat_help = "How many seconds to wait between polling" + +to_address_help :: String +to_address_help = "Send tweets to ADDRESS" + +from_address_help :: String +from_address_help = "Send tweets from ADDRESS" + +sendmail_path_help :: String +sendmail_path_help = "Use PATH to send mail" + +ignore_replies_help :: String +ignore_replies_help = "Ignore replies to other tweets" + +ignore_retweets_help :: String +ignore_retweets_help = "Ignore retweets from other users" + +verbose_help :: String +verbose_help = "Be verbose about stuff" + +arg_spec :: Mode (CmdArgs OptionalCfg) +arg_spec = + cmdArgsMode $ + OptionalCfg { + consumer_key = + def &= typ "KEY" + &= groupname "Twitter API" + &= help consumer_key_help, + + consumer_secret = + def &= typ "SECRET" + &= groupname "Twitter API" + &= help consumer_secret_help, + + access_token = + def &= typ "TOKEN" + &= groupname "Twitter API" + &= help access_token_help, + + access_secret = + def &= typ "SECRET" + &= groupname "Twitter API" + &= help access_secret_help, + + heartbeat = + def &= groupname "Miscellaneous" + &= help heartbeat_help, + + ignore_replies = + def &= groupname "Miscellaneous" + &= help ignore_replies_help, + + ignore_retweets = + def &= groupname "Miscellaneous" + &= help ignore_retweets_help, + + verbose = + def &= groupname "Miscellaneous" + &= help verbose_help, + + sendmail_path = + def &= typ "PATH" + &= groupname "Mail Options" + &= help sendmail_path_help, + + from_address = + def &= typ "ADDRESS" + &= groupname "Mail Options" + &= help from_address_help, + + to_address = + def &= typ "ADDRESS" + &= groupname "Mail Options" + &= help to_address_help, + + usernames = + def &= args + &= typ "USERNAMES" } + + &= program program_name + &= summary my_summary + &= details [description] + &= helpArg [groupname "Common flags"] + &= versionArg [groupname "Common flags"] + +show_help :: IO (CmdArgs OptionalCfg) +show_help = withArgs ["--help"] parse_args + + + +parse_args :: IO (CmdArgs OptionalCfg) +parse_args = do + x <- getArgs + let y = process arg_spec x + case y of + Right result -> return result + Left err -> do + hPutStrLn stderr err + exitWith (ExitFailure exit_args_parse_failed) + + +-- | Really get the command-line arguments. This calls 'parse_args' +-- first to replace the default "wrong number of arguments" error, +-- and then runs 'cmdArgsApply' on the result to do what the +-- 'cmdArgs' function usually does. +apply_args :: IO OptionalCfg +apply_args = + parse_args >>= cmdArgsApply diff --git a/src/Configuration.hs b/src/Configuration.hs index b4b29f3..39dd4e6 100644 --- a/src/Configuration.hs +++ b/src/Configuration.hs @@ -4,7 +4,9 @@ -- module Configuration ( - Cfg(..) + Cfg(..), + default_config, + merge_optional ) where @@ -21,8 +23,9 @@ data Cfg = sendmail_path :: String, from_address :: Maybe String, to_address :: Maybe String, - verbose :: Bool } - + verbose :: Bool, + usernames :: [String] } + deriving (Show) default_config :: Cfg @@ -37,7 +40,8 @@ default_config = sendmail_path = "/usr/sbin/sendmail", from_address = Nothing, to_address = Nothing, - verbose = False } + verbose = False, + usernames = [] } merge_optional :: Cfg -> OC.OptionalCfg -> Cfg merge_optional cfg opt_cfg = @@ -53,6 +57,7 @@ merge_optional cfg opt_cfg = (merge' (from_address cfg) (OC.from_address opt_cfg)) (merge' (to_address cfg) (OC.to_address opt_cfg)) (merge (verbose cfg) (OC.verbose opt_cfg)) + ((usernames cfg) ++ (OC.usernames opt_cfg)) where merge :: a -> Maybe a -> a merge x Nothing = x diff --git a/src/ExitCodes.hs b/src/ExitCodes.hs index 11c03f9..653b1c9 100644 --- a/src/ExitCodes.hs +++ b/src/ExitCodes.hs @@ -1,9 +1,17 @@ -- |All exit codes that the program can return (excepting -- ExitSuccess). There's only one, since the program will try and fail -- forever upon errors. -module ExitCodes +module ExitCodes ( + exit_args_parse_failed, + exit_no_usernames + ) where -- |Indicates that the command-line arguments could not be parsed. exit_args_parse_failed :: Int exit_args_parse_failed = 1 + +-- | No usernames found on either the command-line or in a config +-- file. +exit_no_usernames :: Int +exit_no_usernames = 2 diff --git a/src/Html.hs b/src/Html.hs index 2f93325..2a3b483 100644 --- a/src/Html.hs +++ b/src/Html.hs @@ -1,4 +1,7 @@ -module Html +module Html ( + html_tests, + replace_entities + ) where import Test.Framework (Test, testGroup) diff --git a/src/Mail.hs b/src/Mail.hs index db5673f..ecfa2af 100644 --- a/src/Mail.hs +++ b/src/Mail.hs @@ -1,6 +1,12 @@ -- |Email functions and data types. -module Mail +module Mail ( + Message(..), + default_headers, + print_sendmail_result, + rfc822_now, + sendmail + ) where import Control.Concurrent @@ -50,15 +56,6 @@ instance Show Message where else (intercalate "\n" (headers m)) ++ "\n" --- |Pad a string on the left with zeros until the entire string has --- length n. -pad_left :: String -> Int -> String -pad_left str n - | n < (length str) = str - | otherwise = (replicate num_zeros '0') ++ str - where num_zeros = n - (length str) - - -- | Constructs a 'String' in RFC822 date format for the current -- date/time. diff --git a/src/Main.hs b/src/Main.hs index 14539c1..40703d7 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -2,17 +2,25 @@ module Main where import Control.Concurrent (forkIO, threadDelay) -import Control.Monad (forever, unless, when) +import Control.Monad (forever, when) import Data.Aeson (decode) import Data.List ((\\)) +import Data.Monoid ((<>)) import Data.Time.LocalTime (TimeZone, getCurrentTimeZone) -import System.Exit (ExitCode(..), exitSuccess, exitWith) +import System.Exit (ExitCode(..), exitWith) import System.IO (hPutStrLn, stderr) import CommandLine -import Configuration (Cfg(..)) -import ExitCodes -import Mail +import Configuration (Cfg(..), default_config, merge_optional) +import ExitCodes (exit_no_usernames) +import qualified OptionalConfiguration as OC +import Mail ( + Message(..), + default_headers, + print_sendmail_result, + rfc822_now, + sendmail + ) import Twitter.Http import Twitter.Status import Twitter.User @@ -185,27 +193,22 @@ construct_message cfg = do -- forking, main loops forever. main :: IO () main = do - errors <- parse_errors - - -- If there were errors parsing the command-line options, - -- print them and exit. - unless (null errors) $ do - hPutStrLn stderr (concat errors) - putStrLn help_text - exitWith (ExitFailure exit_args_parse_failed) + -- And a Cfg object. + rc_cfg <- OC.from_rc + cmd_cfg <- apply_args - -- Next, check to see if the 'help' option was passed to the - -- program. If it was, display the help, and exit successfully. - help <- help_set - when (help) $ do - putStrLn help_text - exitSuccess + -- Merge the config file options with the command-line ones, + -- prefering the command-line ones. + let opt_config = rc_cfg <> cmd_cfg - -- Get the list of usernames. - usernames <- parse_usernames + -- Finally, update a default config with any options that have been + -- set in either the config file or on the command-line. + let cfg = merge_optional default_config opt_config - -- And a Cfg object. - cfg <- get_cfg + when (null $ usernames cfg) $ do + hPutStrLn stderr "ERROR: no usernames supplied." + _ <- show_help + exitWith (ExitFailure exit_no_usernames) -- If we have both a "To" and "From" address, we'll create a -- message object to be passed to all of our threads. @@ -213,7 +216,7 @@ main = do -- Execute run_twat on each username in a new thread. let run_twat_curried = run_twat cfg message - _ <- mapM (forkIO . run_twat_curried) usernames + _ <- mapM (forkIO . run_twat_curried) (usernames cfg) _ <- forever $ -- This thread (the one executing main) doesn't do anything, diff --git a/src/OptionalConfiguration.hs b/src/OptionalConfiguration.hs index 5363543..11add85 100644 --- a/src/OptionalConfiguration.hs +++ b/src/OptionalConfiguration.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} -- | The program will parse ~/.twatrc for any available configuration @@ -7,14 +9,24 @@ -- the merged OptionalCfgs. -- -module OptionalConfiguration +module OptionalConfiguration ( + OptionalCfg(..), + from_rc + ) where -import Data.Monoid (Monoid(..)) import qualified Data.Configurator as DC +import qualified Data.Configurator.Types as DCT +import Data.Data (Data) +import Data.Maybe (fromMaybe) +import Data.Monoid (Monoid(..)) +import Data.Typeable (Typeable) --- The same as Cfg, except everything is optional. It's easy to merge --- two of these by simply dropping the Nothings in favor of the Justs. +-- | The same as Cfg, except everything is optional. It's easy to +-- merge two of these by simply dropping the Nothings in favor of +-- the Justs. The 'usernames' are left un-maybed so that cmdargs +-- can parse more than one of them. +-- data OptionalCfg = OptionalCfg { consumer_key :: Maybe String, consumer_secret :: Maybe String, @@ -26,7 +38,9 @@ data OptionalCfg = sendmail_path :: Maybe String, from_address :: Maybe String, to_address :: Maybe String, - verbose :: Maybe Bool } + verbose :: Maybe Bool, + usernames :: [String] } + deriving (Show, Data, Typeable) instance Monoid OptionalCfg where mempty = OptionalCfg @@ -41,6 +55,7 @@ instance Monoid OptionalCfg where Nothing Nothing Nothing + [] cfg1 `mappend` cfg2 = OptionalCfg @@ -55,6 +70,7 @@ instance Monoid OptionalCfg where (merge (from_address cfg1) (from_address cfg2)) (merge (to_address cfg1) (to_address cfg2)) (merge (verbose cfg1) (verbose cfg2)) + (usernames cfg2) -- Use only the usernames from cfg2 where merge :: (Maybe a) -> (Maybe a) -> (Maybe a) merge Nothing Nothing = Nothing @@ -62,6 +78,16 @@ instance Monoid OptionalCfg where merge Nothing (Just x) = Just x merge (Just _) (Just y) = Just y + +instance DCT.Configured [String] where + convert (DCT.List xs) = + mapM convert_string xs + where + convert_string :: DCT.Value -> Maybe String + convert_string = DCT.convert + + convert _ = Nothing + from_rc :: IO OptionalCfg from_rc = do cfg <- DC.load [ DC.Optional "$(HOME)/.twatrc" ] @@ -76,6 +102,8 @@ from_rc = do cfg_from_address <- DC.lookup cfg "from" cfg_to_address <- DC.lookup cfg "to" cfg_verbose <- DC.lookup cfg "verbose" + cfg_usernames <- DC.lookup cfg "usernames" + return $ OptionalCfg cfg_consumer_key cfg_consumer_secret @@ -88,4 +116,4 @@ from_rc = do cfg_from_address cfg_to_address cfg_verbose - + (fromMaybe [] cfg_usernames) diff --git a/src/StringUtils.hs b/src/StringUtils.hs index 5593968..43e4264 100644 --- a/src/StringUtils.hs +++ b/src/StringUtils.hs @@ -1,5 +1,8 @@ -- | Miscellaneous functions for manipulating string. -module StringUtils +module StringUtils ( + listify, + string_utils_tests + ) where import Test.Framework (Test, testGroup) diff --git a/src/Twitter/Http.hs b/src/Twitter/Http.hs index 3b83485..be10b86 100644 --- a/src/Twitter/Http.hs +++ b/src/Twitter/Http.hs @@ -1,4 +1,8 @@ -module Twitter.Http +module Twitter.Http ( + get_user_new_statuses, + get_user_timeline, + http_get + ) where import qualified Data.ByteString.Lazy as B @@ -13,7 +17,7 @@ import Web.Authenticate.OAuth ( newOAuth, signOAuth) -import Configuration +import Configuration (Cfg(..)) -- |The API URL of username's timeline. -- @@ -32,13 +36,6 @@ user_timeline_url username = "&include_rts=true&", "count=10" ] -status_url :: Integer -> String -status_url status_id = - concat [ "https://api.twitter.com/", - "1.1/", - "statuses/", - "show.json?id=", - (show status_id) ] -- | Given username's last status id, constructs the API URL for -- username's new statuses. Essentially, 'user_timeline_url' with a @@ -50,11 +47,6 @@ user_new_statuses_url username last_status_id = url = user_timeline_url username since_id = show last_status_id -get_status :: Cfg -> Integer -> IO B.ByteString -get_status cfg status_id = do - let uri = status_url status_id - http_get cfg uri - -- | Return's username's timeline. get_user_timeline :: Cfg -> String -> IO B.ByteString diff --git a/src/Twitter/Status.hs b/src/Twitter/Status.hs index 0bc60fa..3508593 100644 --- a/src/Twitter/Status.hs +++ b/src/Twitter/Status.hs @@ -1,7 +1,14 @@ {-# LANGUAGE NoMonomorphismRestriction #-} -- | Functions and data for working with Twitter statuses. -module Twitter.Status +module Twitter.Status ( + Status(..), + Timeline, + get_max_status_id, + pretty_print, + status_tests, + utc_time_to_rfc822 + ) where import Control.Applicative ((<$>), (<*>)) @@ -23,7 +30,7 @@ import Text.Regex (matchRegex, mkRegex) import Html (replace_entities) import StringUtils (listify) -import Twitter.User +import Twitter.User (User(..), screen_name_to_timeline_url) data Status = Status { created_at :: Maybe UTCTime, diff --git a/src/Twitter/User.hs b/src/Twitter/User.hs index a1eed3a..988cf3c 100644 --- a/src/Twitter/User.hs +++ b/src/Twitter/User.hs @@ -1,5 +1,8 @@ -- | Functions and data for working with Twitter users. -module Twitter.User +module Twitter.User ( + User(..), + screen_name_to_timeline_url + ) where import Control.Applicative ((<$>)) diff --git a/twat.cabal b/twat.cabal index c2890fe..0d307f4 100644 --- a/twat.cabal +++ b/twat.cabal @@ -18,6 +18,7 @@ executable twat authenticate-oauth == 1.4.*, base == 4.*, bytestring == 0.10.*, + cmdargs == 0.10.*, conduit == 1.*, configurator == 0.2.*, directory == 1.2.*, @@ -76,6 +77,7 @@ test-suite testsuite authenticate-oauth == 1.4.*, base == 4.*, bytestring == 0.10.*, + cmdargs == 0.10.*, conduit == 1.*, configurator == 0.2.*, directory == 1.2.*,