As part of adding -w in december I cleaned up/adjusted register field
widths, and didn't make all the tests pass. This commit makes one more
width adjustment
(one space after the date instead of two) and fixes all tests depending on register output.
Revisiting the "directory 1.2 can be installed with older GHC, so we'd better pin it in the cabal file" change.
Requiring directory 1.2 made hledger-web uninstallable with GHC < 7.6 because current yesod depends on ghc
which depends on a particular directory version and can't be upgraded. This is a smarter fix, which should let
all hledger packages build with whatever directory version is installed.
hledger now requires directory >= 1.2. This might make installation
more complex on old GHC versions; if it turns out to be needed,
perhaps it can be conditionalised again, more accurately, in the cabal file.
- A transaction code may be entered following the date in parentheses, eg: DATE (CODE)
- A transaction comment (possibly containing tags) may be entered following the description, eg: DESC ; COMMENT
- A posting comment may be entered following the amount, eg: AMOUNT ; COMMENT
With one or more command line arguments, they will used as defaults
for the first transaction, and history will be ignored. Subsequent
transactions will use history for defaults (and now only the best match
from history is shown).
- tidier output
- show more help
- suggest . only for recording, not for quitting (though it still works)
- show each transaction after adding it (#52)
- don't parse . as a zero amount
- don't show [] when there's no default
This refactoring fixes an O(n^2) slowdown in the balance command with
large numbers of accounts. It's now speedy, and the implementation is
clearer. To facilitate this, the Account type now represents a tree of
accounts which can easily be traversed up or down (and/or flattened
into a list).
Benchmark on a 2010 macbook:
+-------------------------------------------++--------------+------------+--------+
| || before: | after: | |
| || hledger-0.18 | hledgeropt | ledger |
+===========================================++==============+============+========+
| -f data/100x100x10.journal balance || 0.21 | 0.07 | 0.09 |
| -f data/1000x1000x10.journal balance || 10.13 | 0.47 | 0.62 |
| -f data/1000x10000x10.journal balance || 40.67 | 0.67 | 1.01 |
| -f data/10000x1000x10.journal balance || 15.01 | 3.22 | 2.36 |
| -f data/10000x1000x10.journal balance aa || 4.77 | 4.40 | 2.33 |
+-------------------------------------------++--------------+------------+--------+