1 From: "Lars Kellogg-Stedman" <lars@seas.harvard.edu>
2 To: notmuch@notmuchmail.org
3 Date: Tue, 17 Nov 2009 19:58:29 -0500
4 Subject: [notmuch] "notmuch help" outputs to stderr?
5 Message-ID: <20091118005829.GB25380@dottiness.seas.harvard.edu>
7 I'm just noticing that 'notmuch help ...' outputs to stderr, which
8 isn't terribly intuitive. For example, the obvious invocation:
12 ...isn't terribly helpful.
14 I've attached a patch that lets usage() take a FILE * argument so that
15 you can output to stderr in response to usage errors, and stdout in
16 response to an explicit request.
19 Lars Kellogg-Stedman <lars at seas.harvard.edu>
20 Senior Technologist, Computing and Information Technology
21 Harvard University School of Engineering and Applied Sciences
23 -------------- next part --------------
24 diff --git a/notmuch.c b/notmuch.c
25 index c47e640..a35cb99 100644
28 @@ -157,23 +157,23 @@ command_t commands[] = {
38 - fprintf (stderr, "Usage: notmuch <command> [args...]\n");
39 - fprintf (stderr, "\n");
40 - fprintf (stderr, "Where <command> and [args...] are as follows:\n");
41 - fprintf (stderr, "\n");
42 + fprintf (out, "Usage: notmuch <command> [args...]\n");
43 + fprintf (out, "\n");
44 + fprintf (out, "Where <command> and [args...] are as follows:\n");
45 + fprintf (out, "\n");
47 for (i = 0; i < ARRAY_SIZE (commands); i++) {
48 command = &commands[i];
50 - fprintf (stderr, "\t%s\t%s\n\n", command->name, command->summary);
51 + fprintf (out, "\t%s\t%s\n\n", command->name, command->summary);
54 - fprintf (stderr, "Use \"notmuch help <command>\" for more details on each command.\n\n");
55 + fprintf (out, "Use \"notmuch help <command>\" for more details on each command.\n\n");
59 @@ -183,8 +183,8 @@ notmuch_help_command (unused (void *ctx), int argc, char *argv[])
63 - fprintf (stderr, "The notmuch mail system.\n\n");
65 + fprintf (stdout, "The notmuch mail system.\n\n");
70 -------------- next part --------------
71 A non-text attachment was scrubbed...
73 Type: application/pgp-signature
76 URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091117/03ed852d/attachment.pgp>