First attempt at implementation
This commit is contained in:
parent
5d241e19f8
commit
48a785ff97
16
app/Main.hs
16
app/Main.hs
|
@ -61,16 +61,12 @@ parseArgs (Args t dir h v c r) = do
|
|||
if not (null h)
|
||||
then putStr $ "\n\n" ++ h ++ "\n\n"
|
||||
else putStr "\n"
|
||||
mkIndex r . filter (isSuffixOf ".gmi") =<< getDirectoryContents dir
|
||||
mapM_ (mkIndex r) . filter (isSuffixOf ".gmi") =<< getDirectoryContents dir
|
||||
|
||||
mkIndex :: Bool -> [String] -> IO ()
|
||||
mkIndex True l = mapM_ (putStrLn . ("=> " ++)) l
|
||||
-- where firstLine f = do
|
||||
-- print $ head . lines =<< readFile f
|
||||
mkIndex False l = mapM_ (putStrLn . ("=> " ++)) l
|
||||
|
||||
firstLine :: FilePath -> IO ()
|
||||
firstLine f = do
|
||||
putStr . head . lines =<< readFile f
|
||||
mkIndex :: Bool -> FilePath -> IO ()
|
||||
mkIndex True l = do
|
||||
line <- readFile l
|
||||
putStrLn $ "=> " ++ l ++ (head . lines $ line)
|
||||
mkIndex False l = putStrLn $ "=> " ++ l
|
||||
|
||||
--compose = (++) <$> ("=> " ++) <*> (show . length) <*> (head . lines =<< readFile)
|
||||
|
|
Loading…
Reference in a new issue