summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2012-02-16 11:54:55 +0100
committerAndreas Gruenbacher <agruen@linbit.com>2012-02-16 11:54:55 +0100
commit243de652883f2b9c36c0987a1a6e24c55922ed49 (patch)
tree5d96fdc02103afc97381aee4183822fa05ee3d9a
parent611e4b1be3f4517dbb74b965b05b802d12f11249 (diff)
downloadquilt-fixes-0.51.tar.gz
quilt mail: Implement option -M to read the introduction message from a filefixes-0.51
-rw-r--r--quilt/mail.in25
1 files changed, 21 insertions, 4 deletions
diff --git a/quilt/mail.in b/quilt/mail.in
index 25f4cab..fcdc46e 100644
--- a/quilt/mail.in
+++ b/quilt/mail.in
@@ -21,7 +21,7 @@ fi
usage()
{
- printf $"Usage: quilt mail {--mbox file|--send} [-m text] [--prefix prefix] [--sender ...] [--from ...] [--to ...] [--cc ...] [--bcc ...] [--subject ...] [--reply-to message] [first_patch [last_patch]]\n"
+ printf $"Usage: quilt mail {--mbox file|--send} [-m text] [-M file] [--prefix prefix] [--sender ...] [--from ...] [--to ...] [--cc ...] [--bcc ...] [--subject ...] [--reply-to message] [first_patch [last_patch]]\n"
if [ x$1 = x-h ]
then
printf $"
@@ -37,6 +37,9 @@ first, and a last patch name of \`-' denotes the last patch in the series.
used, the editor will not be invoked, and the patches will be
processed immediately.
+-M file
+ Like the -m option, but read the introduction from file.
+
--prefix prefix
Use an alternate prefix in the bracketed part of the subjects
generated. Defaults to \`patch'.
@@ -159,9 +162,10 @@ join_lines() {
'
}
-options=`getopt -o m:h --long from:,to:,cc:,bcc:,subject: \
- --long send,mbox:,charset:,sender: \
- --long prefix:,reply-to:,signature: -- "$@"`
+options=`getopt -o m:M:h \
+ --long from:,to:,cc:,bcc:,subject: \
+ --long send,mbox:,charset:,sender: \
+ --long prefix:,reply-to:,signature: -- "$@"`
if [ $? -ne 0 ]
then
@@ -180,8 +184,21 @@ while true
do
case "$1" in
-m)
+ if [ -n "$opt_message" ]
+ then
+ echo "Introduction message already specified" >&2
+ exit 1
+ fi
opt_message=$2
shift 2 ;;
+ -M)
+ if [ -n "$opt_message" ]
+ then
+ echo "Introduction message already specified" >&2
+ exit 1
+ fi
+ opt_message=$(< "$2")
+ shift 2 ;;
--sender)
opt_sender=$2
shift 2 ;;