blob: c3aa3b5c09be596c6a57a50067c47463d8ab5be4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
|