5 import System.Console.CmdArgs (
16 -- Get the version from Cabal.
17 import Paths_htsn (version)
18 import Data.Version (showVersion)
20 import OptionalConfiguration (OptionalConfiguration(..))
23 description = "Parse XML files from The Sports Network."
25 program_name :: String
29 my_summary = program_name ++ "-" ++ (showVersion version)
31 password_help :: String
33 "Password to use when connecting to the feed"
35 output_directory_help :: String
36 output_directory_help =
37 "Directory in which to output the XML files; must be writable"
39 username_help :: String
41 "Username to use when connecting to the feed"
43 arg_spec :: OptionalConfiguration
45 OptionalConfiguration {
46 password = def &= typ "PASSWORD" &= help password_help,
47 output_directory = def &= typDir &= help output_directory_help,
48 username = def &= typ "USERNAME" &= help username_help,
49 -- Using "def" below for the FeedHosts causes the list to show up in
50 -- reverse. Don't ask me why.
51 feed_hosts = def &= typ "HOSTNAMES" }
52 &= program program_name
54 &= details [description]
58 get_args :: IO OptionalConfiguration
59 get_args = cmdArgs arg_spec