From 1f5f1b5e78f68e943c5e74bbdf28468304f00bde Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 20 Aug 2011 19:49:07 +0000 Subject: [PATCH] convert: don't fail when there's no default journal file --- hledger/Hledger/Cli/Convert.hs | 4 ++-- hledger/Hledger/Cli/Main.hs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hledger/Hledger/Cli/Convert.hs b/hledger/Hledger/Cli/Convert.hs index 192dba93f..f2adbb05a 100644 --- a/hledger/Hledger/Cli/Convert.hs +++ b/hledger/Hledger/Cli/Convert.hs @@ -84,8 +84,8 @@ type CsvRecord = [String] -- | Read the CSV file named as an argument and print equivalent journal transactions, -- using/creating a .rules file. -convert :: CliOpts -> Journal -> IO () -convert opts _ = do +convert :: CliOpts -> IO () +convert opts = do let csvfile = headDef "" $ patterns_ $ reportopts_ opts when (null csvfile) $ error' "please specify a csv data file." let diff --git a/hledger/Hledger/Cli/Main.hs b/hledger/Hledger/Cli/Main.hs index f22283b03..cab18f8eb 100644 --- a/hledger/Hledger/Cli/Main.hs +++ b/hledger/Hledger/Cli/Main.hs @@ -70,7 +70,7 @@ runWith opts = run' opts | any (cmd `isPrefixOf`) ["accounts","balance"] = showModeHelpOr accountsmode $ withJournalDo opts balance | any (cmd `isPrefixOf`) ["activity","histogram"] = showModeHelpOr activitymode $ withJournalDo opts histogram | cmd `isPrefixOf` "add" = showModeHelpOr addmode $ withJournalDo opts add - | cmd `isPrefixOf` "convert" = showModeHelpOr convertmode $ withJournalDo opts convert + | cmd `isPrefixOf` "convert" = showModeHelpOr convertmode $ convert opts | any (cmd `isPrefixOf`) ["entries","print"] = showModeHelpOr entriesmode $ withJournalDo opts print' | any (cmd `isPrefixOf`) ["postings","register"] = showModeHelpOr postingsmode $ withJournalDo opts register | cmd `isPrefixOf` "stats" = showModeHelpOr statsmode $ withJournalDo opts stats