]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/Configuration.hs
Don't remove imported files by default.
[dead/htsn-import.git] / src / Configuration.hs
index d56cc936e6fc6983ae94ea78cc57885de27cbe54..4d76c739d25be973c33f49feab618284fa05f949 100644 (file)
@@ -11,6 +11,7 @@ import System.Console.CmdArgs.Default ( Default(..) )
 import System.Log ( Priority( INFO ) )
 
 import Backend ( Backend(..) )
+import ConnectionString ( ConnectionString )
 import qualified OptionalConfiguration as OC (
   OptionalConfiguration(..),
   merge_maybes )
@@ -20,9 +21,10 @@ import qualified OptionalConfiguration as OC (
 data Configuration =
   Configuration {
     backend           :: Backend,
-    connection_string :: String,
+    connection_string :: ConnectionString,
     log_file          :: Maybe FilePath,
     log_level         :: Priority,
+    remove            :: Bool,
     syslog            :: Bool }
     deriving (Show)
 
@@ -34,6 +36,7 @@ instance Default Configuration where
           connection_string = def,
           log_file          = def,
           log_level         = INFO,
+          remove            = def,
           syslog            = def }
 
 
@@ -49,6 +52,7 @@ merge_optional cfg opt_cfg =
     (merge (connection_string cfg) (OC.connection_string opt_cfg))
     (OC.merge_maybes (log_file cfg) (OC.log_file opt_cfg))
     (merge (log_level cfg) (OC.log_level opt_cfg))
+    (merge (remove cfg) (OC.remove opt_cfg))
     (merge (syslog cfg) (OC.syslog opt_cfg))
   where
     -- | If the thing on the right is Just something, return that