Re: [PATCH] add has: query prefix to search for specific properties
[notmuch-archives.git] / f2 / 16c8de91d4529d32b5381dcb3dcfcbc707a367
1 Return-Path: <tomi.ollila@iki.fi>\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 arlo.cworth.org (Postfix) with ESMTP id BDC986DE0173\r
6  for <notmuch@notmuchmail.org>; Wed, 30 Mar 2016 13:50:27 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.627\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.627 tagged_above=-999 required=5 tests=[AWL=-0.025,\r
12   SPF_NEUTRAL=0.652] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id zBk0bOeRv9CZ for <notmuch@notmuchmail.org>;\r
16  Wed, 30 Mar 2016 13:50:19 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18  by arlo.cworth.org (Postfix) with ESMTP id 42AA96DE00DF\r
19  for <notmuch@notmuchmail.org>; Wed, 30 Mar 2016 13:50:18 -0700 (PDT)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21  by guru.guru-group.fi (Postfix) with ESMTP id ED6A81000CA;\r
22  Wed, 30 Mar 2016 23:50:39 +0300 (EEST)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH 1/2] CLI: add print_status_database\r
26 In-Reply-To: <1459303814-31988-2-git-send-email-david@tethera.net>\r
27 References: <1459303814-31988-1-git-send-email-david@tethera.net>\r
28  <1459303814-31988-2-git-send-email-david@tethera.net>\r
29 User-Agent: Notmuch/0.21+99~g7cbc880 (http://notmuchmail.org) Emacs/24.3.1\r
30  (x86_64-unknown-linux-gnu)\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
32  $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
33  !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
34 Date: Wed, 30 Mar 2016 23:50:39 +0300\r
35 Message-ID: <m2oa9vofkw.fsf@guru.guru-group.fi>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.20\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42  <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
44  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
49  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Wed, 30 Mar 2016 20:50:27 -0000\r
51 \r
52 On Wed, Mar 30 2016, David Bremner <david@tethera.net> wrote:\r
53 \r
54 > This could probably be used at quite a few places in the existing code,\r
55 > but in the immediate future I plan to use in some new code in\r
56 > notmuch-dump\r
57 > ---\r
58 >  notmuch-client.h |  5 +++++\r
59 >  status.c         | 17 +++++++++++++++++\r
60 >  2 files changed, 22 insertions(+)\r
61 >\r
62 > diff --git a/notmuch-client.h b/notmuch-client.h\r
63 > index 18e6c60..b3d0b66 100644\r
64 > --- a/notmuch-client.h\r
65 > +++ b/notmuch-client.h\r
66 > @@ -462,6 +462,11 @@ print_status_query (const char *loc,\r
67 >                   const notmuch_query_t *query,\r
68 >                   notmuch_status_t status);\r
69 >  \r
70 > +notmuch_status_t\r
71 > +print_status_database (const char *loc,\r
72 > +                    const notmuch_database_t *database,\r
73 > +                    notmuch_status_t status);\r
74 > +\r
75 >  #include "command-line-arguments.h"\r
76 >  \r
77 >  extern char *notmuch_requested_db_uuid;\r
78 > diff --git a/status.c b/status.c\r
79 > index 8fa81cb..45d3fb4 100644\r
80 > --- a/status.c\r
81 > +++ b/status.c\r
82 > @@ -19,3 +19,20 @@ print_status_query (const char *loc,\r
83 >      }\r
84 >      return status;\r
85 >  }\r
86 > +\r
87 > +notmuch_status_t\r
88 > +print_status_database (const char *loc,\r
89 > +                 const notmuch_database_t *notmuch,\r
90 > +                 notmuch_status_t status)\r
91 > +{\r
92 > +    if (status) {\r
93 > +     const char *msg;\r
94 > +\r
95 > +     fprintf (stderr, "%s: %s\n", loc,\r
96 > +              notmuch_status_to_string (status));\r
97 > +     msg = notmuch_database_status_string (notmuch);\r
98 > +     if (msg)\r
99 > +         fputs (msg, stderr);\r
100 > +    }\r
101 > +    return status;\r
102 \r
103 LGTM (whole series).\r
104 \r
105 I was going to complain about the naming of 'print_status_database()' \r
106 but David already got through (in 39c54df2) print_status_query() so\r
107 that ship sailed already (perhaps that it happened is good :).\r
108 \r
109 > +}\r
110 > -- \r
111 > 2.8.0.rc3\r