mirror of
https://github.com/joshuaclayton/unused.git
synced 2024-08-15 15:50:26 +03:00
Refactor in preparation for progress bar
This commit is contained in:
parent
6ee18cf1c9
commit
dcfaa9355e
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user