Commit Graph

5 Commits

Author SHA1 Message Date
Simon Michael
9766f65ac7 imp:import: show info output on stderr, not stdout 2025-08-14 14:23:53 +01:00
Simon Michael
40620666f8 imp: cli: rename --rules-file to --rules; tweak options help
For brevity, and consistency with --conf.
--rules-file remains supported, as a hidden option.

hledger's main mode now supports the hidden legacy flags,
as the command modes do.
2024-06-25 18:37:55 +01:00
Jonathan Dowland
8b14022d97 ;test:import: update matchgroup functest for #2158
Also re-format the comments. Some of the comments within the conditional
blocks were actually being parsed as case-insensitive regexes to match
against each record. Luckily this didn't impact the results.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:38 +00:00
Jonathan Dowland
aaf50c165c test: import: functional tests for match group interpolation
Add functional tests for matching substrings in field matchers and
interpolating them into the corresponding field assignments. Check
the following properties and use-cases:

 * Use-case 1: matching a portion of a date in a known format
   (YYY-MM-DD) and writing a comment-command to warp a posting date.
   Useful for credit cards.
 * Use-case 2: match a portion of a CSV field and use it as an
   account assignment. Useful for my byzantine setup with two
   separate ledgers cross-importing to each other.
 * Ensure bracketed portions of field matchers are captured.
 * Ensure bracketed portions of record matchers are captured.
 * Check match token numerical offset is relative to match group,
   not the whole rules file.
 * Check nested matches work.
 * Ensure match group token expansion works with or without
   surrounding text.

Signed-off-by: Jonathan Dowland <jon@dow.land>
2023-11-08 13:49:39 -08:00
Simon Michael
ec2a774b18 cli, lib: move functional tests into hledger/test/ 2020-11-16 08:47:41 -08:00