From 13e07576700dfdbc0d42af3acbd19b028fd14379 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 3 Jan 2012 12:12:37 +0000 Subject: [PATCH] less obscure error when the journal file path contains a tilde --- hledger/Hledger/Cli/Options.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hledger/Hledger/Cli/Options.hs b/hledger/Hledger/Cli/Options.hs index a60d895d6..844488037 100644 --- a/hledger/Hledger/Cli/Options.hs +++ b/hledger/Hledger/Cli/Options.hs @@ -426,10 +426,10 @@ defaultBalanceFormatString = [ journalFilePathFromOpts :: CliOpts -> IO String journalFilePathFromOpts opts = do f <- myJournalPath - return $ errorIfContainsTilde $ fromMaybe f $ file_ opts - -errorIfContainsTilde s |'~' `elem` s = error' "unsupported literal ~ found in environment variable, please adjust" - | otherwise = s + let f' = fromMaybe f $ file_ opts + if '~' `elem` f' + then error' $ printf "~ in the journal file path is not supported, please adjust (%s)" f' + else return f' aliasesFromOpts :: CliOpts -> [(AccountName,AccountName)] aliasesFromOpts = map parseAlias . alias_