]> gitweb.michael.orlitzky.com - dead/htsn.git/blobdiff - src/CommandLine.hs
Disable syslog by default.
[dead/htsn.git] / src / CommandLine.hs
index 6d894b91f55048c746f2c02d07a1f1251f97836c..c96fb6b568018f4eeb3462e4e8f42ab0552d8e54 100644 (file)
@@ -6,6 +6,7 @@ where
 
 import System.Console.CmdArgs (
   (&=),
+  args,
   cmdArgs,
   def,
   details,
@@ -20,8 +21,7 @@ import System.Console.CmdArgs (
 import Paths_htsn (version)
 import Data.Version (showVersion)
 
-import OptionalConfiguration (OptionalConfiguration(..))
-
+import OptionalConfiguration ( OptionalConfiguration(..) )
 
 -- | The description of the program, displayed as part of the help.
 description :: String
@@ -39,7 +39,7 @@ my_summary = program_name ++ "-" ++ (showVersion version)
 -- | A description of the "log_file" option.
 log_file_help :: String
 log_file_help =
-  "If syslog == False, log to the given file."
+  "Log to the given file."
 
 log_level_help :: String
 log_level_help =
@@ -58,7 +58,7 @@ output_directory_help =
 -- | A description of the "syslog" option.
 syslog_help :: String
 syslog_help =
-  "Enable (default) or disable logging to syslog."
+  "Enable logging to syslog."
 
 -- | A description of the "username" option.
 username_help :: String
@@ -71,13 +71,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       = def &= 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]