From 3ab482e77662e64ba3729d3a793c91b979ef01c6 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sun, 16 Dec 2012 22:17:26 +1900 Subject: [PATCH] [PATCH 4/7] reply: Support --format-version --- d5/561b8150f2a0dcdf7cd1036cc2a2221dd65f57 | 140 ++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 d5/561b8150f2a0dcdf7cd1036cc2a2221dd65f57 diff --git a/d5/561b8150f2a0dcdf7cd1036cc2a2221dd65f57 b/d5/561b8150f2a0dcdf7cd1036cc2a2221dd65f57 new file mode 100644 index 000000000..449172763 --- /dev/null +++ b/d5/561b8150f2a0dcdf7cd1036cc2a2221dd65f57 @@ -0,0 +1,140 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id DD055431FB6 + for ; Sat, 15 Dec 2012 19:17:42 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id UxQaiVbm9TFB for ; + Sat, 15 Dec 2012 19:17:42 -0800 (PST) +Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU + [18.9.25.14]) + by olra.theworths.org (Postfix) with ESMTP id 8F42E431FBD + for ; Sat, 15 Dec 2012 19:17:41 -0800 (PST) +X-AuditID: 1209190e-b7f516d0000008e4-aa-50cd3d548867 +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP + id 73.C1.02276.45D3DC05; Sat, 15 Dec 2012 22:17:40 -0500 (EST) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id qBG3HdbT012438; + Sat, 15 Dec 2012 22:17:39 -0500 +Received: from drake.dyndns.org + (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [209.6.116.242]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qBG3HbYW012058 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Sat, 15 Dec 2012 22:17:38 -0500 (EST) +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1Tk4jP-0007c8-Mj; Sat, 15 Dec 2012 22:17:35 -0500 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH 4/7] reply: Support --format-version +Date: Sat, 15 Dec 2012 22:17:26 -0500 +Message-Id: <1355627849-29099-5-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <1355627849-29099-1-git-send-email-amdragon@mit.edu> +References: <1355627849-29099-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixG6nohtiezbA4NQOU4vVc3ksrt+cyezA + 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZcz9NoOx4CFfRf/c5YwNjNe5uxg5OSQETCTe + /fzOCmGLSVy4t56ti5GLQ0hgH6PEyu1PGCGcDYwSBzecZYFwHjFJPOn5xw7hzGWUmDrjAjNI + P5uAhsS2/csZQWwRAWmJnXdng81lFnCU+Lx/ERuILQy0r7f3Glg9i4CqxNTVZ1hAbF4BB4kP + zX/YIO5QlOh+NgHM5gTq3bzlJ5gtBFQz+8hRtgmM/AsYGVYxyqbkVunmJmbmFKcm6xYnJ+bl + pRbpGuvlZpbopaaUbmIEhRKnJN8Oxq8HlQ4xCnAwKvHwWnw9EyDEmlhWXJl7iFGSg0lJlDfH + 8myAEF9SfkplRmJxRnxRaU5q8SFGCQ5mJRHepPlA5bwpiZVVqUX5MClpDhYlcd4rKTf9hQTS + E0tSs1NTC1KLYLIyHBxKErzMNkBDBYtS01Mr0jJzShDSTBycIMN5gIYrg9TwFhck5hZnpkPk + TzEqSonzSoEkBEASGaV5cL2wWH/FKA70ijCvBkgVDzBNwHW/AhrMBDR4uQ3I1cUliQgpqQbG + DR+Y+G/zHRF4uGLt2Uuqa/9nbRVouxhSPeHKT+VrQWW1soUNy3dd+toyl8OIZ2PW6+b7nzkv + rgt9cCVozfRNE0pc1aX1tpbd2n5k4pof4stDOBev22R653+IgFH7zLhK9+n7WQwa5k4Xiut6 + VmftsuL+PE4vyy+Tyl/KuO7/wdF1xGymeLLhSyWW4oxEQy3mouJEABX4TXjQAgAA +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 16 Dec 2012 03:17:43 -0000 + +--- + man/man1/notmuch-reply.1 | 21 +++++++++++++++++++++ + notmuch-reply.c | 3 +++ + 2 files changed, 24 insertions(+) + +diff --git a/man/man1/notmuch-reply.1 b/man/man1/notmuch-reply.1 +index fa04c9e..9fa1956 100644 +--- a/man/man1/notmuch-reply.1 ++++ b/man/man1/notmuch-reply.1 +@@ -57,6 +57,16 @@ to create a reply message intelligently. + Only produces In\-Reply\-To, References, To, Cc, and Bcc headers. + .RE + .RE ++ ++.RS ++.TP 4 ++.BR \-\-format-version=N ++ ++Use the specified structured output format version. This is intended ++for programs that invoke \fBnotmuch\fR(1) internally. If omitted, the ++latest supported version will be used. ++.RE ++ + .RS + .TP 4 + .BR \-\-reply\-to= ( all | sender ) +@@ -99,6 +109,17 @@ formats do not. + .RE + .RE + ++.SH EXIT STATUS ++ ++This command supports the following special exit status codes ++ ++.TP ++.B 20 ++The requested format version is too old. ++.TP ++.B 21 ++The requested format version is too new. ++ + .SH SEE ALSO + + \fBnotmuch\fR(1), \fBnotmuch-config\fR(1), \fBnotmuch-count\fR(1), +diff --git a/notmuch-reply.c b/notmuch-reply.c +index 720749d..22c58ff 100644 +--- a/notmuch-reply.c ++++ b/notmuch-reply.c +@@ -733,6 +733,7 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) + { "sexp", FORMAT_SEXP }, + { "headers-only", FORMAT_HEADERS_ONLY }, + { 0, 0 } } }, ++ { NOTMUCH_OPT_INT, ¬much_format_version, "format-version", 0, 0 }, + { NOTMUCH_OPT_KEYWORD, &reply_all, "reply-to", 'r', + (notmuch_keyword_t []){ { "all", TRUE }, + { "sender", FALSE }, +@@ -759,6 +760,8 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) + reply_format_func = notmuch_reply_format_default; + } + ++ notmuch_exit_if_unsupported_format (); ++ + config = notmuch_config_open (ctx, NULL, NULL); + if (config == NULL) + return 1; +-- +1.7.10.4 + -- 2.26.2