From bc9bdf8108146262aced09927c48ad1266e73bcc Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 24 Feb 2020 16:23:00 -0800 Subject: [PATCH] ;print: refactor, drop unneeded ropts tweak --- hledger/Hledger/Cli/Commands/Print.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hledger/Hledger/Cli/Commands/Print.hs b/hledger/Hledger/Cli/Commands/Print.hs index f29e44131..923eb471b 100644 --- a/hledger/Hledger/Cli/Commands/Print.hs +++ b/hledger/Hledger/Cli/Commands/Print.hs @@ -53,11 +53,11 @@ printEntries opts@CliOpts{reportopts_=ropts} j = do d <- getCurrentDay let q = queryFromOpts d ropts fmt = outputFormatFromOpts opts - (render, ropts') = case fmt of - "txt" -> (entriesReportAsText opts, ropts) - "csv" -> ((++"\n") . printCSV . entriesReportAsCsv, ropts{accountlistmode_=ALFlat}) - _ -> (const $ error' $ unsupportedOutputFormatError fmt, ropts) - writeOutput opts $ render $ entriesReport ropts' q j + render = case fmt of + "txt" -> entriesReportAsText opts + "csv" -> (++"\n") . printCSV . entriesReportAsCsv + _ -> const $ error' $ unsupportedOutputFormatError fmt + writeOutput opts $ render $ entriesReport ropts q j entriesReportAsText :: CliOpts -> EntriesReport -> String entriesReportAsText opts = concatMap (showTransaction . whichtxn)