cmdFeeds :: Config -> IO ()
cmdFeeds cfg = do
  newdirde <- doesDirectoryExist (newFeedDir cfg)
  dirde <- doesDirectoryExist (feedDir cfg)
  if not newdirde then
      displayError $ "new feed dir (" ++ newFeedDir cfg ++ ") does not exist."
    else if not dirde then
      displayError $  "feed dir (" ++ feedDir cfg ++ ") does not exist."
    else
      forM_ (feedUrls cfg) (\url -> do
                log $ "Downloading " ++ fromUrl url
                dlres <- downloadToUnique url (newFeedDir cfg)
                case dlres of
                  Left err -> print err
                  Right fp -> log $ "Wrote file to " ++ newFeedDir cfg </> fp
                )


-- | All processed feeds.
cmdFeeds :: Config -> IO ()
cmdFeeds cfg = do
  newdirde <- doesDirectoryExist (newFeedDir cfg)
  dirde <- doesDirectoryExist (feedDir cfg)
  if not newdirde then
      displayError $ "new feed dir (" ++ newFeedDir cfg ++ ") does not exist."
    else if not dirde then
      displayError $  "feed dir (" ++ feedDir cfg ++ ") does not exist."
    else
      forM_ (feedUrls cfg) (\url -> do
                log $ "Downloading " ++ fromUrl url
                dlres <- downloadToUnique url (newFeedDir cfg)
                case dlres of
                  Left err -> print err
                  Right fp -> log $ "Wrote file to " ++ newFeedDir cfg </> fp
                )


-- | All processed feeds.
cmdFeeds cfg = do
  newdirde <- doesDirectoryExist (newFeedDir cfg)
  dirde <- doesDirectoryExist (feedDir cfg)
  if not newdirde then
      displayError $ "new feed dir (" ++ newFeedDir cfg ++ ") does not exist."
    else if not dirde then
      displayError $  "feed dir (" ++ feedDir cfg ++ ") does not exist."
    else
      forM_ (feedUrls cfg) (\url -> do
                log $ "Downloading " ++ fromUrl url
                dlres <- downloadToUnique url (newFeedDir cfg)
                case dlres of
                  Left err -> print err
                  Right fp -> log $ "Wrote file to " ++ newFeedDir cfg </> fp
                )


-- | All processed feeds.