summaryrefslogtreecommitdiffhomepage
path: root/app/Configuration.hs
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2018-11-26 01:30:39 +0000
committerjao <jao@gnu.org>2018-11-26 01:30:39 +0000
commitf3193c75aced2525f95da8aee3fe6c35eea88b0f (patch)
tree4d71e61e935a725db40ed485a9b2e9352c306a07 /app/Configuration.hs
parentc2a125cefb0bf41140db398248a5b8523b46a42e (diff)
downloadxmobar-f3193c75aced2525f95da8aee3fe6c35eea88b0f.tar.gz
xmobar-f3193c75aced2525f95da8aee3fe6c35eea88b0f.tar.bz2
New option -D, and keeping silent by default
Diffstat (limited to 'app/Configuration.hs')
-rw-r--r--app/Configuration.hs6
1 files changed, 4 insertions, 2 deletions
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