hledger
hledger copied to clipboard
`hledger add` should allow inputting balance assertions
When in hledger add's "Amount X"'s field, inputting 0 = 1234.56 (to check accounts) results in hledger answering A valid hledger amount is required. Eg: 1, $2, 3 EUR, "4 red apples"..
This is most likely due to overzealous sanitization, I guess?
Thoughts: add was intended to be an easy way to get started; it doesn't support all of journal syntax. Should it ? hledger-ui supports add (a), iadd (A), and edit (E) - might be an alternative to firing up vim manually. I don't see any difficulties with implementing this. Maybe you could test it for a few weeks and report your experience - how useful, any problems with failing assertions, etc.
Thanks for the pointer! I'll try it and come back here to try and implement this if I'd still like to use add (if I read correctly your answer you wouldn't be against a patch).
Correct, I would like to see a patch and some real-world testing.