diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ledger | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bin/ledger b/bin/ledger new file mode 100644 index 0000000..c3aa3b5 --- /dev/null +++ b/bin/ledger @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +[ -f /usr/local/bin/ledger ] && prog=/usr/local/bin/ledger + +subcommand=$1 +extra_options=${@:2} + +case $subcommand in + bs) # Balance Sheet + $prog --current --aux-date --no-pager bal ^Assets ^Liabilities $extra_options + ;; + cf) # Cash Flow + $prog --no-pager reg ^Assets ^Liabilities --daily --collapse $extra_options + ;; + is) # Income Statement + $prog --current --aux-date --no-pager reg ^Expenses ^Revenues --daily --collapse $extra_options + $prog --current --aux-date --no-pager bal ^Expenses ^Revenues --collapse $extra_options + ;; + exp) # Expense Compare + $prog --current --aux-date --no-pager bal ^Expenses --depth 1 --sort amount -X USD $extra_options + $prog --current --aux-date --no-pager bal ^Expenses -% --depth 2 --sort amount -X USD $extra_options + ;; + *) + $prog $@ + ;; +esac |