-- | Parses cmd line arguments and dispatches to application commands.
main :: IO ()
main = do
  args <- parseArgs
  ecfg <- getConfig
  case ecfg of
    Left msg -> displayError $ "Error parsing config file: " ++ msg
    Right cfg -> do
      when (argCommandFeeds args) $ cmdFeeds cfg
      when (argCommandTorrents args) $ cmdTorrents cfg
      when (argCommandTest args) $ cmdTest cfg

-- | Fetches all feeds specified in the config.
main :: IO ()
main = do
  args <- parseArgs
  ecfg <- getConfig
  case ecfg of
    Left msg -> displayError $ "Error parsing config file: " ++ msg
    Right cfg -> do
      when (argCommandFeeds args) $ cmdFeeds cfg
      when (argCommandTorrents args) $ cmdTorrents cfg
      when (argCommandTest args) $ cmdTest cfg

-- | Fetches all feeds specified in the config.
main = do
  args <- parseArgs
  ecfg <- getConfig
  case ecfg of
    Left msg -> displayError $ "Error parsing config file: " ++ msg
    Right cfg -> do
      when (argCommandFeeds args) $ cmdFeeds cfg
      when (argCommandTorrents args) $ cmdTorrents cfg
      when (argCommandTest args) $ cmdTest cfg

-- | Fetches all feeds specified in the config.