summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-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