summaryrefslogtreecommitdiff
path: root/me
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2018-06-15 10:53:27 -0700
committerBen Sima <ben@bsima.me>2018-06-15 10:53:27 -0700
commit8316bc418112267e14bbb6873137c7ea33d3fd1b (patch)
tree6dda45292a386851a19e66089f7686039f73a733 /me
parent4ffe8a44461c9036c0a5e5cb5fdec7e61b584123 (diff)
Add status command and improve/condense output a bit
Diffstat (limited to 'me')
-rwxr-xr-xme29
1 files changed, 22 insertions, 7 deletions
diff --git a/me b/me
index 46e8215..0b610f8 100755
--- a/me
+++ b/me
@@ -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}"