12 lines
388 B
Haskell
12 lines
388 B
Haskell
|
main :: IO ()
|
||
|
main = do
|
||
|
hSetBuffering stdout LineBuffering
|
||
|
args <- getArgs
|
||
|
case args of
|
||
|
--[inputFile] -> wholeDoc inputFile
|
||
|
[inputFile, pageNumber] -> do
|
||
|
content <- fmap (unify . updates) . parseDocument <$> BS.readFile inputFile
|
||
|
get content (read pageNumber)
|
||
|
singlePage inputFile (read pageNumber)
|
||
|
_ -> die "Syntax: getContent INPUT_FILE PAGE_NUMBER"
|