- -- Get the input from either stdin, or the file given on the command
- -- line.
- input <- case input_file of
- Nothing -> BS.hGetContents stdin
- Just path -> do
- is_file <- doesFileExist path
- unless is_file $
- exitWith (ExitFailure exit_input_file_doesnt_exist)
- BS.readFile path
-
- -- Do the same for the output handle and stdout.
- output_handle <- case output_file of
- Nothing -> return stdout
- Just path -> openFile path WriteMode
-
- -- Split the input into lines.
+ -- Split stdin into lines, which should result in a list of addresses.
+ input <- BS.hGetContents stdin