about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-05-02 21:30:15 -0400
committerJune McEnroe <june@causal.agency>2020-05-02 21:30:15 -0400
commit92ae4fc94e81d694ca1cb3637efd42101b2763e3 (patch)
tree8db6699ec735e020ac2c535271135e85b23321c1
parentRemove git am from imbox.1 example (diff)
downloadimbox-92ae4fc94e81d694ca1cb3637efd42101b2763e3.tar.gz
imbox-92ae4fc94e81d694ca1cb3637efd42101b2763e3.zip
Fix git-fetch-email argument parsing
Shell script is hard.
-rw-r--r--git-fetch-email.sh21
1 files changed, 11 insertions, 10 deletions
diff --git a/git-fetch-email.sh b/git-fetch-email.sh
index 8fcb66d..83243c7 100644
--- a/git-fetch-email.sh
+++ b/git-fetch-email.sh
@@ -42,17 +42,19 @@ v,verbose log IMAP protocol to standard error
 "
 eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)"
 
-for opt; do
+while [ $# -gt 0 ]; do
+	opt=$1
+	shift
 	case "${opt}" in
-		(-C) cc=$2; shift;;
-		(-F) from=$2; shift;;
-		(-S) subject=$2; shift;;
-		(-T) to=$2; shift;;
+		(-C) cc=$1; shift;;
+		(-F) from=$1; shift;;
+		(-S) subject=$1; shift;;
+		(-T) to=$1; shift;;
 		(-a) apply=1;;
-		(-h) host=$2; shift;;
-		(-m) mailbox=$2; shift;;
-		(-p) port=$2; shift;;
-		(-u) user=$2; shift;;
+		(-h) host=$1; shift;;
+		(-m) mailbox=$1; shift;;
+		(-p) port=$1; shift;;
+		(-u) user=$1; shift;;
 		(-v) verbose=1;;
 		(--no-apply) apply=;;
 		(--no-cc) cc=;;
@@ -62,7 +64,6 @@ for opt; do
 		(--no-verbose) verbose=;;
 		(--) break;;
 	esac
-	shift
 done
 if [ -z "${user:-}" ]; then
 	echo "${0}: username required" >&2
on bell in xtermJune McEnroe 2021-02-07Add bindings for brightness controlJune McEnroe Weirdly the Fn key doesn't change how the F row registers... I wonder if I can do something about that. 2021-02-07Set X key repeat rateJune McEnroe 2021-02-07Bump font size to 12June McEnroe 11 is what I use on macOS, but I feel like my eyes are working harder here. 2021-02-07Fully configure and rebind cwmJune McEnroe This is sort of a mix of trying to emulate macOS somewhat for my muscle memory and just rebinding some of the cwm defaults to use 4- rather than M-. 2021-02-07Add BintiJune McEnroe 2021-02-07Finish configuring xtermJune McEnroe 2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe 2021-02-06Set root window to black on purple snowJune McEnroe 2021-02-06Add xmodmap configurationJune McEnroe 2021-02-06Add initial OpenBSD X configurationJune McEnroe cwm still needs a lot more rebinding, and I need to actually look at its other options. xterm definitely still needs some configuration, but I at least managed to get it to use a decent looking font. Very happy that OpenBSD includes Luxi Mono, which is what my usual font, Go Mono, is based on anyway. Still missing is xmodmap and such. 2021-02-06Add xterm output to schemeJune McEnroe