;bin: hledger-check-buynothing

This commit is contained in:
Simon Michael 2025-11-20 12:25:43 -10:00
parent 4d0550f1b4
commit de0b6603e3
2 changed files with 19 additions and 0 deletions

View File

@ -280,6 +280,11 @@ $ hledger bar -v 1 -f $TIMELOG -D # daily hours, with numbers
```
(or with hledger <1.50: `hledger bar -- ...`)
### hledger-check-buynothing
[`hledger-check-buynothing`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check-buynothing)
checks for no activity in Expense accounts on Buy Nothing Day (or other period).
### hledger-git
[`hledger-git`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-git)

14
bin/hledger-check-buynothing Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
# hledger check-buynothing [-p PERIOD] [OTHERHLEDGERARGS]
# Check for no activity in Expense accounts on Buy Nothing Day (November 28th).
#
# You can specify a different date or period with -p.
# You can add other options/arguments to refine the query.
txns=$(hledger reg type:x -p 11/28 "$@")
if [[ ! "$txns" == "" ]]
then
echo "Buy Nothing failure!"
echo "$txns"
exit 1
fi