Path parsing
This commit is contained in:
parent
e83fd886d0
commit
137b150cc3
10
app/Main.hs
10
app/Main.hs
|
@ -62,12 +62,12 @@ parseArgs (Args t dir h v r c) = do
|
|||
if not (null h)
|
||||
then putStr $ "\n\n" ++ h ++ "\n\n"
|
||||
else putStr "\n"
|
||||
mapM_ (mkIndex r) . filter (isSuffixOf ".gmi") =<< getDirectoryContents dir
|
||||
mapM_ (mkIndex r dir) . filter (isSuffixOf ".gmi") =<< getDirectoryContents dir
|
||||
|
||||
mkIndex :: Bool -> FilePath -> IO ()
|
||||
mkIndex True l = do
|
||||
line <- readFile l
|
||||
mkIndex :: Bool -> FilePath -> FilePath -> IO ()
|
||||
mkIndex True d l = do
|
||||
line <- readFile $ d++"/"++l
|
||||
putStrLn $ "=> " ++ l ++ " " ++ (head . lines $ line)
|
||||
mkIndex False l = putStrLn $ "=> " ++ l
|
||||
mkIndex False _ l = putStrLn $ "=> " ++ l
|
||||
|
||||
--compose = (++) <$> ("=> " ++) <*> (show . length) <*> (head . lines =<< readFile)
|
||||
|
|
Loading…
Reference in a new issue