This CLI tool partially addresses the issue of account lifetime (see, for example, simonmichael/hledger#1389).
We use a so-called locker file that contains directives of the form
# this is a comment
; this is also a comment
; there are no inline comments
; grammar is [close|open] Date AccountName, e.g.
close 2022-01-01 assets:cash
open 2022/01/02 equity
; empty lines are ignored
The tool would check the presence of postings to the specified accounts and report errors if
- there are postings on dates strictly after the
closedate - there are postings on dates strictly before the
opendate
We accept all dates that are valid for a journal, barring partial dates.
In other words, the formats YYYY-MM-DD, YYYY/MM/DD, and YYYY.MM.DD are accepted, leading zeros are authorised.
Usage: hlocker [-v|--version] [-f|--journal-file JOURNAL_FILE]
[--locker-file LOCKER_FILE]
Close/Open account assertions for hledger journal files
Available options:
-h,--help Show this help text
-v,--version Print version and exit
-f,--journal-file JOURNAL_FILE
path to JOURNAL_FILE
--locker-file LOCKER_FILE
path to LOCKER_FILE
We look for journal file, if -f is not provided in the $LEDGER_FILE environement variable and in $HOME/.hledger.journal.
We look for locker file, if --locker-file is not specified, in $HLEDGER_LOCKER_FILE and in $HOME/.hledger.locker.
There is also a --debug flag for a more verbose output.
Right now, only stack build and stack install. Other installation methods are not yet tested/written.
Artefacts in releases will be available soon-ish.
There is a primitive nix build script in the root of the project. nix-build should work. Not really tested.
- Read journal entries from
stdin - Specify
lockervia CLI options
- building and installing with
nix - building and installing with
cabal - better test coverage
- CI/CD