hledger icon indicating copy to clipboard operation
hledger copied to clipboard

`hledger add` should allow inputting balance assertions

Open Ekleog opened this issue 8 years ago • 3 comments

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?

Ekleog avatar May 25 '17 01:05 Ekleog

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.

simonmichael avatar May 25 '17 02:05 simonmichael

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).

Ekleog avatar May 25 '17 13:05 Ekleog

Correct, I would like to see a patch and some real-world testing.

simonmichael avatar Jun 04 '17 23:06 simonmichael