]> git.notmuchmail.org Git - notmuch/blob - test/corpus/cur/23:2,
test: Move corpus emails into maildir directory structure
[notmuch] / test / corpus / cur / 23:2,
1 Date: Tue, 17 Nov 2009 19:58:29 -0500
2 From: Lars Kellogg-Stedman <lars@seas.harvard.edu>
3 To: notmuch <notmuch@notmuchmail.org>
4 Message-ID: <20091118005829.GB25380@dottiness.seas.harvard.edu>
5 MIME-Version: 1.0
6 User-Agent: Mutt/1.5.19 (2009-01-05)
7 Subject: [notmuch] "notmuch help" outputs to stderr?
8 X-BeenThere: notmuch@notmuchmail.org
9 X-Mailman-Version: 2.1.12
10 Precedence: list
11 List-Id: "Use and development of the notmuch mail system."
12         <notmuch.notmuchmail.org>
13 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
14         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
15 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
16 List-Post: <mailto:notmuch@notmuchmail.org>
17 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
18 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
19         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
20 Content-Type: multipart/mixed; boundary="===============1359248349=="
21 Sender: notmuch-bounces@notmuchmail.org
22 Errors-To: notmuch-bounces@notmuchmail.org
23
24
25 --===============1359248349==
26 Content-Type: multipart/signed; micalg=pgp-sha256;
27         protocol="application/pgp-signature"; boundary="L6iaP+gRLNZHKoI4"
28 Content-Disposition: inline
29
30
31 --L6iaP+gRLNZHKoI4
32 Content-Type: multipart/mixed; boundary="z6Eq5LdranGa6ru8"
33 Content-Disposition: inline
34
35
36 --z6Eq5LdranGa6ru8
37 Content-Type: text/plain; charset=us-ascii
38 Content-Disposition: inline
39 Content-Transfer-Encoding: quoted-printable
40
41 I'm just noticing that 'notmuch help ...' outputs to stderr, which
42 isn't terribly intuitive.  For example, the obvious invocation:
43
44   notmuch help | less
45
46 =2E..isn't terribly helpful.
47
48 I've attached a patch that lets usage() take a FILE * argument so that
49 you can output to stderr in response to usage errors, and stdout in
50 response to an explicit request.
51
52 --=20
53 Lars Kellogg-Stedman <lars@seas.harvard.edu>
54 Senior Technologist, Computing and Information Technology
55 Harvard University School of Engineering and Applied Sciences
56
57
58 --z6Eq5LdranGa6ru8
59 Content-Type: text/plain; charset=us-ascii
60 Content-Disposition: attachment; filename="notmuch-help.patch"
61 Content-Transfer-Encoding: quoted-printable
62
63 diff --git a/notmuch.c b/notmuch.c
64 index c47e640..a35cb99 100644
65 --- a/notmuch.c
66 +++ b/notmuch.c
67 @@ -157,23 +157,23 @@ command_t commands[] =3D {
68  };
69 =20
70  static void
71 -usage (void)
72 +usage (FILE *out)
73  {
74      command_t *command;
75      unsigned int i;
76 =20
77 -    fprintf (stderr, "Usage: notmuch <command> [args...]\n");
78 -    fprintf (stderr, "\n");
79 -    fprintf (stderr, "Where <command> and [args...] are as follows:\n");
80 -    fprintf (stderr, "\n");
81 +    fprintf (out, "Usage: notmuch <command> [args...]\n");
82 +    fprintf (out, "\n");
83 +    fprintf (out, "Where <command> and [args...] are as follows:\n");
84 +    fprintf (out, "\n");
85 =20
86      for (i =3D 0; i < ARRAY_SIZE (commands); i++) {
87         command =3D &commands[i];
88 =20
89 -       fprintf (stderr, "\t%s\t%s\n\n", command->name, command->summary);
90 +       fprintf (out, "\t%s\t%s\n\n", command->name, command->summary);
91      }
92 =20
93 -    fprintf (stderr, "Use \"notmuch help <command>\" for more details on e=
94 ach command.\n\n");
95 +    fprintf (out, "Use \"notmuch help <command>\" for more details on each=
96  command.\n\n");
97  }
98 =20
99  static int
100 @@ -183,8 +183,8 @@ notmuch_help_command (unused (void *ctx), int argc, cha=
101 r *argv[])
102      unsigned int i;
103 =20
104      if (argc =3D=3D 0) {
105 -       fprintf (stderr, "The notmuch mail system.\n\n");
106 -       usage ();
107 +       fprintf (stdout, "The notmuch mail system.\n\n");
108 +       usage (stdout);
109         return 0;
110      }
111 =20
112
113 --z6Eq5LdranGa6ru8--
114
115 --L6iaP+gRLNZHKoI4
116 Content-Type: application/pgp-signature
117 Content-Disposition: inline
118
119 -----BEGIN PGP SIGNATURE-----
120 Version: GnuPG v1.4.9 (GNU/Linux)
121
122 iQEcBAEBCAAGBQJLA0a1AAoJENdGlQYxQazYr78IAJtqTWIpBqSdOWqTzt/r4XNn
123 KJ5mWAoNfq4H+3kx3xoWOFYS7qAYeJoHQWCDbMdb+zEXvPX6hMFn9+OxRN+N5FdQ
124 uxGTugSG9xSsK28oGDCQUtr5uheo+tH0jygPjI+LTD97vjUYS4K2qzhLGFJmpLcj
125 1akMJXM0gSdPZT8dJyjxvC15pgboLspE4+b6jexXmd4UoFvXgqvjkYHeV4Wk+s0L
126 xu+HkCGXL9WHYc3t171fFAru4Zd1AUxFQl4BZ2Y+OqRZUrD28Mtz3zGQxbJQoifl
127 JFrgPAWioLN71SkVq/y+efjvGSl0osPpKU5dftMmyY1zV7k7mMlO08ZSJU+wANA=
128 =Iijt
129 -----END PGP SIGNATURE-----
130
131 --L6iaP+gRLNZHKoI4--
132
133 --===============1359248349==
134 Content-Type: text/plain; charset="us-ascii"
135 MIME-Version: 1.0
136 Content-Transfer-Encoding: 7bit
137 Content-Disposition: inline
138
139 _______________________________________________
140 notmuch mailing list
141 notmuch@notmuchmail.org
142 http://notmuchmail.org/mailman/listinfo/notmuch
143
144 --===============1359248349==--
145