import: make --dry output valid journal format
[ci skip]
This commit is contained in:
		
							parent
							
								
									08acad3f42
								
							
						
					
					
						commit
						e33cce52bc
					
				| @ -51,7 +51,7 @@ importcmd opts@CliOpts{rawopts_=rawopts,inputopts_=iopts} j = do | ||||
|           case sortBy (comparing tdate) $ jtxns newj of | ||||
|             [] -> putStrLn "no new transactions" | ||||
|             newts | dryrun -> do | ||||
|               printf "would import %d new transactions:\n\n" (length newts) | ||||
|               printf "; would import %d new transactions:\n\n" (length newts) | ||||
|               -- TODO how to force output here ? | ||||
|               -- length (jtxns newj) `seq` print' opts{rawopts_=("explicit",""):rawopts} newj | ||||
|               mapM_ (putStr . showTransactionUnelided) newts | ||||
|  | ||||
| @ -409,6 +409,12 @@ New transactions are detected in the same way as print --new: | ||||
| by assuming transactions are always added to the input files in increasing date order, | ||||
| and by saving `.latest.FILE` state files. | ||||
| 
 | ||||
| The --dry-run output is in journal format, so you can filter it, eg  | ||||
| to see only uncategorised transactions:  | ||||
| ```shell | ||||
| $ hledger import --dry ... | hledger -f- print unknown --ignore-assertions | ||||
| ``` | ||||
| 
 | ||||
| ## incomestatement | ||||
| Show an income statement. Alias: is. | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user