From f3193c75aced2525f95da8aee3fe6c35eea88b0f Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 26 Nov 2018 01:30:39 +0000 Subject: New option -D, and keeping silent by default --- app/Configuration.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/Configuration.hs') diff --git a/app/Configuration.hs b/app/Configuration.hs index 340124a..3e30730 100644 --- a/app/Configuration.hs +++ b/app/Configuration.hs @@ -29,9 +29,11 @@ import qualified Xmobar as X -- | Reads the configuration files or quits with an error readConfig :: FilePath -> String -> IO (X.Config,[String]) readConfig f usage = do - let err m = error $ f ++ ": " ++ m ++ "\n" ++ usage + let err m = error $ f ++ ": " ++ m file <- liftIO $ fileExist f - r <- if file then X.readConfig X.defaultConfig f else err "file not found" + r <- if file + then X.readConfig X.defaultConfig f + else err $ "file not found" ++ "\n" ++ usage case r of Left e -> err (show e) Right res -> return res -- cgit v1.2.3