1 {-# LANGUAGE DeriveDataTypeable #-}
10 import System.Console.CmdArgs
12 -- Get the version from Cabal.
13 import Paths_haeres (version)
14 import Data.Version (showVersion)
16 ns_description :: String
18 "Confirm delegation of NS records. " ++
19 "This is the default mode."
21 mx_description :: String
22 mx_description = "Confirm delegation of MX records."
24 program_name :: String
25 program_name = "haeres"
28 my_summary = program_name ++ "-" ++ (showVersion version)
32 "IP address of server to query " ++
33 "(will use resolv.conf if not specified)"
36 Delegates { get_delegates :: [String] }
37 deriving (Data, Show, Typeable)
39 instance Default Delegates where
43 NS { server :: Maybe String, delegates :: Delegates } |
44 MX { server :: Maybe String, delegates :: Delegates }
45 deriving (Data, Show, Typeable)
49 modes [ns &= auto, mx]
50 &= program program_name
55 groupname "Common flags"]
56 &= versionArg [explicit,
59 groupname "Common flags"]
61 -- The repetition here is necessary, some Template Haskell magic
66 &= groupname "Common flags"
74 &= details [ns_description]
79 &= groupname "Common flags"
87 &= details [mx_description]
90 get_args = cmdArgs arg_spec