From: Michael Orlitzky Date: Sun, 22 Dec 2013 03:13:23 +0000 (-0500) Subject: Take feed_hosts as the final list of arguments. X-Git-Tag: 0.0.2~24 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=a37e06422eefce32514b38e3b44bb119250c4003;p=dead%2Fhtsn.git Take feed_hosts as the final list of arguments. --- diff --git a/src/CommandLine.hs b/src/CommandLine.hs index 6d894b9..ad4f867 100644 --- a/src/CommandLine.hs +++ b/src/CommandLine.hs @@ -6,6 +6,7 @@ where import System.Console.CmdArgs ( (&=), + args, cmdArgs, def, details, @@ -20,8 +21,8 @@ import System.Console.CmdArgs ( import Paths_htsn (version) import Data.Version (showVersion) -import OptionalConfiguration (OptionalConfiguration(..)) - +import OptionalConfiguration ( OptionalConfiguration(..) ) +import TSN.FeedHosts ( FeedHosts(..) ) -- | The description of the program, displayed as part of the help. description :: String @@ -71,13 +72,16 @@ username_help = arg_spec :: OptionalConfiguration arg_spec = OptionalConfiguration { + -- 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. + feed_hosts = FeedHosts [] &= typ "HOSTNAMES" &= args, log_file = def &= typFile &= help log_file_help, log_level = def &= typ "LEVEL" &= help log_level_help, password = def &= typ "PASSWORD" &= help password_help, output_directory = def &= typDir &= help output_directory_help, syslog = def &= typ "BOOL" &= help syslog_help, - username = def &= typ "USERNAME" &= help username_help, - feed_hosts = def &= typ "HOSTNAMES" } + username = def &= typ "USERNAME" &= help username_help } &= program program_name &= summary my_summary &= details [description]