From: Petr Baudis Date: Mon, 22 Sep 2008 15:46:38 +0000 (+0200) Subject: tg mail: Simplify array usage X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=8db01713f1f45ae38066b9da307e90eda40c43c8;p=topgit.git tg mail: Simplify array usage --- diff --git a/tg-mail.sh b/tg-mail.sh index cf68155..7e394b8 100644 --- a/tg-mail.sh +++ b/tg-mail.sh @@ -37,16 +37,14 @@ from="$(echo "$header" | grep '^From:' | sed 's/From:\s*//')" to="$(echo "$header" | grep '^To:' | sed 's/To:\s*//')" -# XXX I can't get quoting right without arrays -[ -n "$from" ] && from=(--from "$from") -[ -n "$to" ] && to=(--to "$to") # FIXME there could be multimple To - +# XXX: I can't get quoting right without arrays people=() -[ -n "$from" ] && people=("${people[@]}" "${from[@]}") -[ -n "$to" ] && people=("${people[@]}" "${to[@]}") +[ -n "$from" ] && people=("${people[@]}" --from "$from") +# FIXME: there could be multimple To +[ -n "$to" ] && people=("${people[@]}" --to "$to") -# NOTE git-send-email handles cc itself +# NOTE: git-send-email handles cc itself git send-email "${people[@]}" "$patchfile" rm "$patchfile"