+ 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
+
+ -- Check the optional config for missing required options.
+ --when (isNothing (OC.password opt_config)) $ do
+ -- report_error "No password supplied."
+ -- exitWith (ExitFailure exit_no_password)
+
+ --when (isNothing (OC.username opt_config)) $ do
+ -- report_error "No username supplied."
+ --exitWith (ExitFailure exit_no_username)
+
+ conn <- connectPostgreSQL (connection_string cfg)
+ r <- report conn (both cfg) (detail cfg)
+ putStrLn r
+-- disconnect conn