X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCommandLine.hs;h=f2ee1b26585a3bbe6f7a42fdd026514ce9b7d22f;hb=93702736986b10815324647bb002ab2c269afec0;hp=b734d770b5dde0bcc9c6309254a746aaa60d5eda;hpb=f6cb0ba712e06e52d080b86e9eba6c3585a7514b;p=dead%2Fhtsn.git diff --git a/src/CommandLine.hs b/src/CommandLine.hs index b734d77..f2ee1b2 100644 --- a/src/CommandLine.hs +++ b/src/CommandLine.hs @@ -21,6 +21,7 @@ import System.Console.CmdArgs ( import Paths_htsn (version) import Data.Version (showVersion) +import FeedHosts ( FeedHosts(..) ) import OptionalConfiguration ( OptionalConfiguration(..) ) -- | The description of the program, displayed as part of the help. @@ -36,6 +37,7 @@ my_summary :: String my_summary = program_name ++ "-" ++ (showVersion version) +-- | A description of the "daemonize" option. daemonize_help :: String daemonize_help = "Run as a daemon, in the background." @@ -45,6 +47,7 @@ log_file_help :: String log_file_help = "Log to the given file." +-- | A description of the "log_level" option. log_level_help :: String log_level_help = "How verbose should the logs be? One of INFO, WARNING, ERROR." @@ -52,21 +55,24 @@ log_level_help = -- | A description of the "output_directory" option. output_directory_help :: String output_directory_help = - "Directory in which to output the XML files; must be writable" + "Directory in which to output the XML files; must be writable." -- | A description of the "password" option. password_help :: String password_help = - "Password to use when connecting to the feed" + "Password to use when connecting to the feed." +-- | A description of the "pidfile" option. pidfile_help :: String pidfile_help = "Location to create PID file (daemon only)." +-- | A description of the "run_as_group" option. run_as_group_help :: String run_as_group_help = "System group to run as (daemon only)." +-- | A description of the "run_as_user" option. run_as_user_help :: String run_as_user_help = "System user to run under (daemon only)." @@ -79,7 +85,7 @@ syslog_help = -- | A description of the "username" option. username_help :: String username_help = - "Username to use when connecting to the feed" + "Username to use when connecting to the feed." -- | A data structure representing the possible command-line -- options. The CmdArgs library is doing heavy magic beneath the @@ -87,11 +93,13 @@ username_help = arg_spec :: OptionalConfiguration arg_spec = OptionalConfiguration { + daemonize = def &= typ "BOOL" &= help daemonize_help, + -- Use an empty list for feed_hosts since cmdargs will appends to -- the default when the user supplies feed hosts. If he specifies -- any, those are all we should use. - daemonize = def &= typ "BOOL" &= help daemonize_help, - feed_hosts = def &= typ "HOSTNAMES" &= args, + feed_hosts = FeedHosts [] &= typ "HOSTNAMES" &= args, + log_file = def &= typFile &= help log_file_help, log_level = def &= typ "LEVEL" &= help log_level_help, output_directory = def &= typDir &= help output_directory_help,