convert: don't fail when there's no default journal file
This commit is contained in:
parent
48c523e937
commit
1f5f1b5e78
@ -84,8 +84,8 @@ type CsvRecord = [String]
|
|||||||
|
|
||||||
-- | Read the CSV file named as an argument and print equivalent journal transactions,
|
-- | Read the CSV file named as an argument and print equivalent journal transactions,
|
||||||
-- using/creating a .rules file.
|
-- using/creating a .rules file.
|
||||||
convert :: CliOpts -> Journal -> IO ()
|
convert :: CliOpts -> IO ()
|
||||||
convert opts _ = do
|
convert opts = do
|
||||||
let csvfile = headDef "" $ patterns_ $ reportopts_ opts
|
let csvfile = headDef "" $ patterns_ $ reportopts_ opts
|
||||||
when (null csvfile) $ error' "please specify a csv data file."
|
when (null csvfile) $ error' "please specify a csv data file."
|
||||||
let
|
let
|
||||||
|
|||||||
@ -70,7 +70,7 @@ runWith opts = run' opts
|
|||||||
| any (cmd `isPrefixOf`) ["accounts","balance"] = showModeHelpOr accountsmode $ withJournalDo opts balance
|
| any (cmd `isPrefixOf`) ["accounts","balance"] = showModeHelpOr accountsmode $ withJournalDo opts balance
|
||||||
| any (cmd `isPrefixOf`) ["activity","histogram"] = showModeHelpOr activitymode $ withJournalDo opts histogram
|
| any (cmd `isPrefixOf`) ["activity","histogram"] = showModeHelpOr activitymode $ withJournalDo opts histogram
|
||||||
| cmd `isPrefixOf` "add" = showModeHelpOr addmode $ withJournalDo opts add
|
| 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`) ["entries","print"] = showModeHelpOr entriesmode $ withJournalDo opts print'
|
||||||
| any (cmd `isPrefixOf`) ["postings","register"] = showModeHelpOr postingsmode $ withJournalDo opts register
|
| any (cmd `isPrefixOf`) ["postings","register"] = showModeHelpOr postingsmode $ withJournalDo opts register
|
||||||
| cmd `isPrefixOf` "stats" = showModeHelpOr statsmode $ withJournalDo opts stats
|
| cmd `isPrefixOf` "stats" = showModeHelpOr statsmode $ withJournalDo opts stats
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user