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>
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
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
25 --===============1359248349==
26 Content-Type: multipart/signed; micalg=pgp-sha256;
27 protocol="application/pgp-signature"; boundary="L6iaP+gRLNZHKoI4"
28 Content-Disposition: inline
32 Content-Type: multipart/mixed; boundary="z6Eq5LdranGa6ru8"
33 Content-Disposition: inline
37 Content-Type: text/plain; charset=us-ascii
38 Content-Disposition: inline
39 Content-Transfer-Encoding: quoted-printable
41 I'm just noticing that 'notmuch help ...' outputs to stderr, which
42 isn't terribly intuitive. For example, the obvious invocation:
46 =2E..isn't terribly helpful.
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.
53 Lars Kellogg-Stedman <lars@seas.harvard.edu>
54 Senior Technologist, Computing and Information Technology
55 Harvard University School of Engineering and Applied Sciences
59 Content-Type: text/plain; charset=us-ascii
60 Content-Disposition: attachment; filename="notmuch-help.patch"
61 Content-Transfer-Encoding: quoted-printable
63 diff --git a/notmuch.c b/notmuch.c
64 index c47e640..a35cb99 100644
67 @@ -157,23 +157,23 @@ command_t commands[] =3D {
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");
86 for (i =3D 0; i < ARRAY_SIZE (commands); i++) {
87 command =3D &commands[i];
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);
93 - fprintf (stderr, "Use \"notmuch help <command>\" for more details on e=
95 + fprintf (out, "Use \"notmuch help <command>\" for more details on each=
100 @@ -183,8 +183,8 @@ notmuch_help_command (unused (void *ctx), int argc, cha=
105 - fprintf (stderr, "The notmuch mail system.\n\n");
107 + fprintf (stdout, "The notmuch mail system.\n\n");
116 Content-Type: application/pgp-signature
117 Content-Disposition: inline
119 -----BEGIN PGP SIGNATURE-----
120 Version: GnuPG v1.4.9 (GNU/Linux)
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=
129 -----END PGP SIGNATURE-----
133 --===============1359248349==
134 Content-Type: text/plain; charset="us-ascii"
136 Content-Transfer-Encoding: 7bit
137 Content-Disposition: inline
139 _______________________________________________
141 notmuch@notmuchmail.org
142 http://notmuchmail.org/mailman/listinfo/notmuch
144 --===============1359248349==--