less obscure error when the journal file path contains a tilde

This commit is contained in:
Simon Michael 2012-01-03 12:12:37 +00:00
parent 48460b0130
commit 13e0757670

View File

@ -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_