Refactor in preparation for progress bar

This commit is contained in:
Joshua Clayton 2016-05-02 06:03:26 -04:00
parent 6ee18cf1c9
commit dcfaa9355e

View File

@ -8,7 +8,7 @@ import Unused.Types
main :: IO ()
main = do
terms <- pure . lines =<< getContents
results <- pure . concat =<< mapM search terms
results <- executeSearch terms
let response = parseLines $ unlines results
case withOneOccurrence $ withOneFile response of
@ -19,6 +19,11 @@ main = do
return ()
executeSearch :: [String] -> IO [String]
executeSearch terms = do
results <- mapM search terms
return $ concat results
printMatchPair :: (String, [TermMatch]) -> IO ()
printMatchPair (term', matches) = do
setSGR [SetColor Foreground Vivid Red]