--- Take a CIDR String, and exitFailure if it's invalid.
-validate_or_die :: String -> IO ()
-validate_or_die cidr = do
- if (is_valid_cidr cidr)
+main :: IO ()
+main = do
+ -- First, check for any errors that occurred while parsing
+ -- the command line options.
+ errors <- CommandLine.parse_errors
+ if not (null errors)
+ then do
+ hPutStrLn stderr (concat errors)
+ putStrLn CommandLine.help_text
+ exitWith (ExitFailure exit_args_parse_failed)
+ else do -- Nothing
+
+ -- Next, check to see if the 'help' option was passed to the
+ -- program. If it was, display the help, and exit successfully.
+ help_opt_set <- CommandLine.help_set
+ if help_opt_set