X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FMain.hs;h=6fa7da9203645e193d177de6a97ffed87a7c7f97;hb=f81e236ab90102d8afd6d6080131b77d59e38348;hp=eeee9f6b6fe07f4ae40b580e093c818042b253c9;hpb=75038b45b9c379d8313511e58c3c0fe680810883;p=hath.git diff --git a/src/Main.hs b/src/Main.hs index eeee9f6..6fa7da9 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -130,10 +130,19 @@ main = do let regexes = map cidr_to_regex cidrs putStrLn $ alternate regexes Reduce -> do - mapM (putStrLn . show) (combine_all cidrs) + _ <- mapM (putStrLn . show) (combine_all cidrs) return () Dupe -> do - mapM (putStrLn . show) dupes + _ <- mapM (putStrLn . show) dupes return () where dupes = cidrs \\ (combine_all cidrs) + Diff -> do + _ <- mapM putStrLn deletions + _ <- mapM putStrLn additions + return () + where + dupes = cidrs \\ (combine_all cidrs) + deletions = map (\s -> "-" ++ (show s)) dupes + newcidrs = (combine_all cidrs) \\ cidrs + additions = map (\s -> "+" ++ (show s)) newcidrs