]> gitweb.michael.orlitzky.com - hath.git/blobdiff - src/Main.hs
Added the 'Dupe' mode of operation.
[hath.git] / src / Main.hs
index 2fdcfd0459c1b2c88ecd2980e6de90a4a709cd95..a3b1bfe4a811faad00f6e8503b58de540bd8703f 100644 (file)
@@ -1,9 +1,10 @@
-import Data.List (intercalate, intersperse)
+import Data.List ((\\), intercalate, intersperse)
 import System.Exit (ExitCode(..), exitWith)
 import System.IO (stderr, hPutStrLn)
 
 import Cidr (Cidr(..),
-             cidr_from_string)
+             cidr_from_string,
+             combine_all)
 
 import CommandLine (help_set,
                     help_text,
@@ -122,4 +123,10 @@ main = do
         let regexes = map cidr_to_regex cidrs
         putStrLn $ alternate regexes
     Reduce -> do
-        putStr input
+        mapM (putStrLn . show) (combine_all cidrs)
+        return ()
+    Dupe -> do
+         mapM (putStrLn . show) dupes
+         return ()
+         where
+           dupes = cidrs \\ (combine_all cidrs)