From 243de652883f2b9c36c0987a1a6e24c55922ed49 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Thu, 16 Feb 2012 11:54:55 +0100 Subject: quilt mail: Implement option -M to read the introduction message from a file --- quilt/mail.in | 25 +++++++++++++++++++++---- 1 file 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 ;; -- cgit