1 Return-Path: <novalazy@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id A5B78431FAF
\r
6 for <notmuch@notmuchmail.org>; Mon, 28 May 2012 06:32:00 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id WdEA05QfPXlf for <notmuch@notmuchmail.org>;
\r
17 Mon, 28 May 2012 06:32:00 -0700 (PDT)
\r
18 Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com
\r
19 [209.85.210.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 22794431FAE
\r
22 for <notmuch@notmuchmail.org>; Mon, 28 May 2012 06:32:00 -0700 (PDT)
\r
23 Received: by dadg9 with SMTP id g9so5241732dad.26
\r
24 for <notmuch@notmuchmail.org>; Mon, 28 May 2012 06:31:58 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
26 h=date:message-id:from:to:subject:in-reply-to:references:mime-version
\r
27 :content-type:content-disposition:content-transfer-encoding;
\r
28 bh=UgTQwJanb1bgx2Hjg0aaMK0wv7oJj6K8eWJv308CGsg=;
\r
29 b=NrJIUws8kYTEDYEP4YLy+5bK8G8eYbII5VgDQko+Y1J+RcMGC0FACyoV91B9G/sZ/Y
\r
30 681Ht5tq34eFkaTIARvMtmLxGysfmh0ansFibsDaAH8slT+C12sTiRWX3OEviIq7CkDY
\r
31 zAQBdt/vufCgJkh2HbOtFwqeu4qwbsOrS8suImVHSx1ecuKZVTUMDhC/9PgPJwi52cmW
\r
32 KvVToiMI2FaatFlhCVv+wTy4j+RgNwSu/uvJpppM+pqqtjiA0vQ+IynQU8XU3eluCqiF
\r
33 q+gBOUX3QhcGTO/hwjWIAIGgLanIhYlp0dqYuQSuKUCvyYbFdtlQrC43a9bAu5qM32dI
\r
35 Received: by 10.68.233.102 with SMTP id tv6mr27313781pbc.153.1338211918235;
\r
36 Mon, 28 May 2012 06:31:58 -0700 (PDT)
\r
37 Received: from localhost (215.42.233.220.static.exetel.com.au.
\r
39 by mx.google.com with ESMTPS id rv5sm19298330pbc.56.2012.05.28.06.31.55
\r
40 (version=TLSv1/SSLv3 cipher=OTHER);
\r
41 Mon, 28 May 2012 06:31:56 -0700 (PDT)
\r
42 Date: Mon, 28 May 2012 23:31:52 +1000
\r
43 Message-ID: <20120528233152.GD2331@hili.localdomain>
\r
44 From: Peter Wang <novalazy@gmail.com>
\r
45 To: notmuch@notmuchmail.org
\r
46 Subject: Re: [PATCH v6 1/6] cli: command line parsing: allow default for
\r
48 In-Reply-To: <1338106946-7611-2-git-send-email-markwalters1009@gmail.com>
\r
49 References: <1338106946-7611-1-git-send-email-markwalters1009@gmail.com>
\r
50 <1338106946-7611-2-git-send-email-markwalters1009@gmail.com>
\r
52 Content-Type: text/plain; charset=utf-8
\r
53 Content-Disposition: inline
\r
54 Content-Transfer-Encoding: 8bit
\r
55 X-BeenThere: notmuch@notmuchmail.org
\r
56 X-Mailman-Version: 2.1.13
\r
58 List-Id: "Use and development of the notmuch mail system."
\r
59 <notmuch.notmuchmail.org>
\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
63 List-Post: <mailto:notmuch@notmuchmail.org>
\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
67 X-List-Received-Date: Mon, 28 May 2012 13:32:00 -0000
\r
69 On Sun, 27 May 2012 09:22:21 +0100, Mark Walters <markwalters1009@gmail.com> wrote:
\r
70 > This changes the parsing for "keyword" options so that if the option
\r
71 > is specified with no argument the argument is parsed as if it were
\r
72 > passed an empty string. This make it easier to add options to existing
\r
73 > boolean arguments (the existing --option can default to TRUE).
\r
75 > command-line-arguments.c | 17 +++++++++++++----
\r
76 > 1 files changed, 13 insertions(+), 4 deletions(-)
\r
78 > diff --git a/command-line-arguments.c b/command-line-arguments.c
\r
79 > index 76b185f..2fb8a1b 100644
\r
80 > --- a/command-line-arguments.c
\r
81 > +++ b/command-line-arguments.c
\r
82 > @@ -11,10 +11,15 @@
\r
85 > static notmuch_bool_t
\r
86 > -_process_keyword_arg (const notmuch_opt_desc_t *arg_desc, const char *arg_str) {
\r
87 > +_process_keyword_arg (const notmuch_opt_desc_t *arg_desc, char next, const char *arg_str) {
\r
89 > const notmuch_keyword_t *keywords = arg_desc->keywords;
\r
91 > + if (next == 0) {
\r
92 > + /* No keyword given */
\r
99 > while (keywords->name) {
\r
100 > if (strcmp (arg_str, keywords->name) == 0) {
\r
101 > if (arg_desc->output_var) {
\r
102 > @@ -24,7 +29,10 @@ _process_keyword_arg (const notmuch_opt_desc_t *arg_desc, const char *arg_str) {
\r
106 > - fprintf (stderr, "unknown keyword: %s\n", arg_str);
\r
111 > + fprintf (stderr, "unknown keyword: %s\n", arg_str);
\r
113 > + fprintf (stderr, "option %s needs a keyword\n", arg_desc->name);
\r
115 I think "keyword argument" is clearer.
\r