;print: refactor, drop unneeded ropts tweak
This commit is contained in:
		
							parent
							
								
									7f16d23898
								
							
						
					
					
						commit
						bc9bdf8108
					
				@ -53,11 +53,11 @@ printEntries opts@CliOpts{reportopts_=ropts} j = do
 | 
				
			|||||||
  d <- getCurrentDay
 | 
					  d <- getCurrentDay
 | 
				
			||||||
  let q = queryFromOpts d ropts
 | 
					  let q = queryFromOpts d ropts
 | 
				
			||||||
      fmt = outputFormatFromOpts opts
 | 
					      fmt = outputFormatFromOpts opts
 | 
				
			||||||
      (render, ropts') = case fmt of
 | 
					      render = case fmt of
 | 
				
			||||||
        "txt"  -> (entriesReportAsText opts,                 ropts)
 | 
					        "txt"  -> entriesReportAsText opts
 | 
				
			||||||
        "csv"  -> ((++"\n") . printCSV . entriesReportAsCsv, ropts{accountlistmode_=ALFlat})
 | 
					        "csv"  -> (++"\n") . printCSV . entriesReportAsCsv
 | 
				
			||||||
        _      -> (const $ error' $ unsupportedOutputFormatError fmt, ropts)
 | 
					        _      -> const $ error' $ unsupportedOutputFormatError fmt
 | 
				
			||||||
  writeOutput opts $ render $ entriesReport ropts' q j
 | 
					  writeOutput opts $ render $ entriesReport ropts q j
 | 
				
			||||||
 | 
					
 | 
				
			||||||
entriesReportAsText :: CliOpts -> EntriesReport -> String
 | 
					entriesReportAsText :: CliOpts -> EntriesReport -> String
 | 
				
			||||||
entriesReportAsText opts = concatMap (showTransaction . whichtxn)
 | 
					entriesReportAsText opts = concatMap (showTransaction . whichtxn)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user