convert: don't fail when there's no default journal file

This commit is contained in:
Simon Michael 2011-08-20 19:49:07 +00:00
parent 48c523e937
commit 1f5f1b5e78
2 changed files with 3 additions and 3 deletions

View File

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

View File

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