From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 0EAB6429E52 for ; Mon, 10 Oct 2011 06:50:06 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 wH7zoK3-v86Z for ; Mon, 10 Oct 2011 06:50:04 -0700 (PDT) Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 0A236429E54 for ; Mon, 10 Oct 2011 06:49:55 -0700 (PDT) Received: from zancas.localnet (fctnnbsc36w-156034064058.pppoe-dynamic.High-Speed.nb.bellaliant.net [156.34.64.58]) (authenticated bits=0) by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id p9ADnqo6010816 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Mon, 10 Oct 2011 10:49:53 -0300 Received: from bremner by zancas.localnet with local (Exim 4.76) (envelope-from ) id 1RDGEq-0006fy-CL; Mon, 10 Oct 2011 10:49:52 -0300 From: david@tethera.net To: notmuch@notmuchmail.org Subject: [PATCH 6/6] notmuch-dump: deprecate use of output file argument. Date: Mon, 10 Oct 2011 10:49:21 -0300 Message-Id: <1318254561-25386-7-git-send-email-david@tethera.net> X-Mailer: git-send-email 1.7.6.3 In-Reply-To: <1318254561-25386-1-git-send-email-david@tethera.net> References: <8739f2qhla.fsf@zancas.localnet> <1318254561-25386-1-git-send-email-david@tethera.net> Cc: David Bremner 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: Mon, 10 Oct 2011 13:50:06 -0000 From: David Bremner We print an intentionally non-specific message on stderr, since it isn't clear if there will be some global output file argument to replace. We update the test suite atomically, since it relies on having the same text in two files. --- notmuch-dump.c | 1 + test/dump-restore | 4 ++++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/notmuch-dump.c b/notmuch-dump.c index ac5d074..409c86a 100644 --- a/notmuch-dump.c +++ b/notmuch-dump.c @@ -42,6 +42,7 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[]) return 1; if (argc && strcmp (argv[0], "--") != 0) { + fprintf (stderr, "Warning: the output file argument of dump is deprecated.\n"); output = fopen (argv[0], "w"); if (output == NULL) { fprintf (stderr, "Error opening %s for writing: %s\n", diff --git a/test/dump-restore b/test/dump-restore index d8db259..5f3f0db 100755 --- a/test/dump-restore +++ b/test/dump-restore @@ -12,6 +12,10 @@ test_begin_subtest "dump outfile" notmuch dump dump-outfile.actual test_expect_equal_file dump.expected dump-outfile.actual +test_begin_subtest "dump outfile # deprecated" +test_expect_equal "Warning: the output file argument of dump is deprecated."\ + "$(notmuch dump /dev/null 2>&1)" + test_begin_subtest "dump outfile --" notmuch dump dump-1-arg-dash.actual test_expect_equal_file dump.expected dump-1-arg-dash.actual -- 1.7.6.3