1 {-# LANGUAGE DoAndIfThenElse #-}
11 import CommandLine (show_help)
12 import Configuration (Cfg(..), get_cfg)
13 import LWN.Page (epublish, page_from_url)
16 -- | If we're given an empty path, return a handle to
17 -- 'stdout'. Otherwise, open the given file and return a read/write
19 get_output_handle :: FilePath -> IO Handle
20 get_output_handle path =
24 openBinaryFile path WriteMode
30 page <- page_from_url cfg (article cfg)
33 output_handle <- get_output_handle (output cfg)
34 epublish p output_handle