diff options
author | Ben Sima <ben@bsima.me> | 2018-06-15 10:53:27 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2018-06-15 10:53:27 -0700 |
commit | 8316bc418112267e14bbb6873137c7ea33d3fd1b (patch) | |
tree | 6dda45292a386851a19e66089f7686039f73a733 /me | |
parent | 4ffe8a44461c9036c0a5e5cb5fdec7e61b584123 (diff) |
Add status command and improve/condense output a bit
Diffstat (limited to 'me')
-rwxr-xr-x | me | 29 |
1 files changed, 22 insertions, 7 deletions
@@ -1,16 +1,31 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash # FIXME: replace ~/me with ~/docs cur=$PWD -for d in ~/config/ ~/org/ ~/web/ ~/bin/ ~/.password-store/ ~/me/ -do - cd "${d}" +function usage { + echo "Usage: $0 [status]" 1>&2 + exit 1 +} - dirname=${d/\/home\/ben/\~} - status=$(unbuffer git status -sb | tr -d '#') - printf "%-20s: %s\n\n" "${dirname}" "${status}" +function allStatuses { + for d in ~/.password-store ~/bin ~/config ~/org ~/web ~/me + do + cd "${d}" + + dirname=${d/\/home\/ben/\~} + status=$(unbuffer git status -sb | tr -d '#') + printf "%-20s:: %s\n" "${dirname}" "${status}" + done + exit 0 +} + +while true; do + case "$1" in + status) allStatuses ;; + *) usage ;; + esac done cd "${cur}" |