X-Git-Url: http://gitweb.michael.orlitzky.com/?p=haeredes.git;a=blobdiff_plain;f=src%2FMain.hs;h=8178209b5dac41ee3692aa545c39f2c63e5d3e4e;hp=f513ec67ff62149c5ec1409940cedbdab1bae7e2;hb=a27c37544ae78ca3940987dfd7119e384422ff3b;hpb=a555c07f5692995bdda0ac03cec1cb0cd5a68225 diff --git a/src/Main.hs b/src/Main.hs index f513ec6..8178209 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -9,8 +9,7 @@ import qualified Data.ByteString.Char8 as BS ( getContents, pack, words ) -import Data.List ( (\\) ) -import Data.String.Utils (join) +import Data.List ( (\\), intersperse ) import Network.DNS ( Domain, FileOrNumericHost(RCHostName), @@ -20,18 +19,19 @@ import Network.DNS ( normalize, normalizeCase, withResolver ) -import System.Exit (ExitCode(..), exitWith) +import System.Exit (ExitCode(ExitFailure), exitWith) import System.IO (hPutStrLn, stderr) - -import CommandLine (Args(..), get_args) +import CommandLine ( + Args(NS,MX,delegates,no_append_root,server,timeout), + get_args) import DNS ( LookupResult, lookupMX', lookupNS', resolve_address ) import ExitCodes (exit_bad_server) -import Timeout (Timeout(..)) +import Timeout (Timeout(seconds)) -- | Given a list of delegates, report results for this @@ -71,6 +71,11 @@ report delgts normalize_function (d, Right raw_hosts) = do (show d) ++ " delegates somewhere else: " ++ (join " " (map show leftovers)) + where + -- Create one big string by joining together a list of smaller + -- strings and placing a delimiter between them. + join :: String -> [String] -> String + join delimiter strings = concat (intersperse delimiter strings) main :: IO ()