+ rc_cfg <- OC.from_rc
+ cmd_cfg <- get_args
+
+ -- Merge the config file options with the command-line ones,
+ -- prefering the command-line ones.
+ let opt_config = rc_cfg <> cmd_cfg
+
+ -- Update a default config with any options that have been set in
+ -- either the config file or on the command-line. We initialize
+ -- logging before the missing parameter checks below so that we can
+ -- log the errors.
+ let cfg = (def :: Configuration) `merge_optional` opt_config
+ init_logging (log_file cfg) (log_level cfg) (syslog cfg)
+
+ -- Check the optional config for missing required options.
+ when (null $ OC.xml_files opt_config) $ do
+ report_error "No XML files given."
+ exitWith (ExitFailure exit_no_xml_files)
+
+ -- We don't do this in parallel (for now?) to keep the error
+ -- messages nice and linear.
+ mapM_ (import_file cfg) (OC.xml_files opt_config)