some fix or other
This commit is contained in:
		
							parent
							
								
									8a5a69005c
								
							
						
					
					
						commit
						e16fc9aeed
					
				
							
								
								
									
										20
									
								
								hledger.hs
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								hledger.hs
									
									
									
									
									
								
							| @ -27,8 +27,8 @@ main = do | |||||||
|   where run cmd opts pats |   where run cmd opts pats | ||||||
|             | Help `elem` opts            = putStr usage |             | Help `elem` opts            = putStr usage | ||||||
|             | cmd `isPrefixOf` "test"     = test     opts pats |             | cmd `isPrefixOf` "test"     = test     opts pats | ||||||
|             | cmd `isPrefixOf` "print"    = printcmd opts pats |             | cmd `isPrefixOf` "print"    = doWithFilteredLedger opts pats printentries | ||||||
|             | cmd `isPrefixOf` "register" = register opts pats |             | cmd `isPrefixOf` "register" = doWithFilteredLedger opts pats printregister | ||||||
|             | cmd `isPrefixOf` "balance"  = balance  opts pats |             | cmd `isPrefixOf` "balance"  = balance  opts pats | ||||||
|             | otherwise                   = putStr usage |             | otherwise                   = putStr usage | ||||||
| 
 | 
 | ||||||
| @ -49,20 +49,10 @@ test opts pats = do | |||||||
|   Tests.quickcheck |   Tests.quickcheck | ||||||
|   return () |   return () | ||||||
| 
 | 
 | ||||||
| printcmd :: Command | printentries l = putStr $ showEntries $ setprecisions $ entries $ rawledger l | ||||||
| printcmd opts pats = do  |     where setprecisions = map (entrySetPrecision (lprecision l)) | ||||||
|   doWithFilteredLedger opts pats printentries |  | ||||||
|     where |  | ||||||
|       printentries l = putStr $ showEntries $ setprecision $ entries $ rawledger l |  | ||||||
|           where |  | ||||||
|             setprecision = map (entrySetPrecision (lprecision l)) |  | ||||||
|        |        | ||||||
| register :: Command | printregister l = putStr $ showTransactionsWithBalances  | ||||||
| register opts pats = do  |  | ||||||
|   doWithFilteredLedger opts pats printregister |  | ||||||
|     where  |  | ||||||
|       printregister l =  |  | ||||||
|           putStr $ showTransactionsWithBalances  |  | ||||||
|                   (sortBy (comparing date) $ ledgerTransactions l) |                   (sortBy (comparing date) $ ledgerTransactions l) | ||||||
|                   nullamt{precision=lprecision l} |                   nullamt{precision=lprecision l} | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user