X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Flwn-epub.git;a=blobdiff_plain;f=src%2FMain.hs;h=1f6d7c5f436a583d5143b05c1cf55aaf4126995e;hp=3ce1eef324283e94ac6ae1cb1850d35edca79619;hb=291c39f59e958a012dd6e4ddec9b0276a4045b45;hpb=00295eded52d532e145e52e832f2baf2cc447b05 diff --git a/src/Main.hs b/src/Main.hs index 3ce1eef..1f6d7c5 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -7,8 +7,11 @@ import System.Directory (doesFileExist) import System.IO ( Handle, IOMode (WriteMode), + hPutStrLn, openBinaryFile, - stdout) + stderr, + stdout + ) import CommandLine (show_help) import Configuration (Cfg(..), get_cfg) @@ -40,12 +43,14 @@ main = do cfg <- case aif of False -> get_login_cookie cfg' True -> return cfg' + page <- page_from_url cfg (article cfg) case page of Just p -> do output_handle <- get_output_handle (output cfg) epublish p output_handle Nothing -> do + hPutStrLn stderr "ERROR: could not parse an LWN page from the given URL." _ <- show_help return ()