diff options
-rw-r--r-- | .zshrc | 4 | ||||
-rw-r--r-- | bin/ledger | 26 |
2 files changed, 29 insertions, 1 deletions
@@ -14,6 +14,8 @@ HISTSIZE=1000 SAVEHIST=1000 HISTFILE=~/.zsh_history +[ -f ~/.dotfiles/bin ] && export PATH="$HOME/.dotfiles/bin:$PATH" + [[ -s /etc/profile.d/autojump.sh ]] && source /etc/profile.d/autojump.sh # proxy @@ -36,7 +38,7 @@ Darwin) # Alias alias ls='ls -G' - alias ll='ls -lG' + alias ll='ls -lhG' ;; Linux) # commands for Linux 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 |