[notmuch] "notmuch help" outputs to stderr?
> I've attached a patch that lets usage() take a FILE * argument so that > you can output to stderr in response to usage errors, and stdout in > response to an explicit request. Whoops, missed a couple of stderr's in that last patch. New one attached. -- Lars Kellogg-Stedman Senior Technologist, Computing and Information Technology Harvard University School of Engineering and Applied Sciences -- next part -- diff --git a/notmuch.c b/notmuch.c index c47e640..446c810 100644 --- a/notmuch.c +++ b/notmuch.c @@ -157,23 +157,23 @@ command_t commands[] = { }; static void -usage (void) +usage (FILE *out) { command_t *command; unsigned int i; -fprintf (stderr, "Usage: notmuch [args...]\n"); -fprintf (stderr, "\n"); -fprintf (stderr, "Where and [args...] are as follows:\n"); -fprintf (stderr, "\n"); +fprintf (out, "Usage: notmuch [args...]\n"); +fprintf (out, "\n"); +fprintf (out, "Where and [args...] are as follows:\n"); +fprintf (out, "\n"); for (i = 0; i < ARRAY_SIZE (commands); i++) { command = &commands[i]; - fprintf (stderr, "\t%s\t%s\n\n", command->name, command->summary); + fprintf (out, "\t%s\t%s\n\n", command->name, command->summary); } -fprintf (stderr, "Use \"notmuch help \" for more details on each command.\n\n"); +fprintf (out, "Use \"notmuch help \" for more details on each command.\n\n"); } static int @@ -183,8 +183,8 @@ notmuch_help_command (unused (void *ctx), int argc, char *argv[]) unsigned int i; if (argc == 0) { - fprintf (stderr, "The notmuch mail system.\n\n"); - usage (); + fprintf (stdout, "The notmuch mail system.\n\n"); + usage (stdout); return 0; } @@ -192,8 +192,8 @@ notmuch_help_command (unused (void *ctx), int argc, char *argv[]) command = &commands[i]; if (strcmp (argv[0], command->name) == 0) { - fprintf (stderr, "Help for \"notmuch %s\":\n\n", argv[0]); - fprintf (stderr, "\t%s\t%s\n\n%s\n\n", command->name, + fprintf (stdout, "Help for \"notmuch %s\":\n\n", argv[0]); + fprintf (stdout, "\t%s\t%s\n\n%s\n\n", command->name, command->summary, command->documentation); return 0; } -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091117/8c0e4dc3/attachment.pgp>
[notmuch] "notmuch help" outputs to stderr?
I'm just noticing that 'notmuch help ...' outputs to stderr, which isn't terribly intuitive. For example, the obvious invocation: notmuch help | less ...isn't terribly helpful. I've attached a patch that lets usage() take a FILE * argument so that you can output to stderr in response to usage errors, and stdout in response to an explicit request. -- Lars Kellogg-Stedman Senior Technologist, Computing and Information Technology Harvard University School of Engineering and Applied Sciences -- next part -- diff --git a/notmuch.c b/notmuch.c index c47e640..a35cb99 100644 --- a/notmuch.c +++ b/notmuch.c @@ -157,23 +157,23 @@ command_t commands[] = { }; static void -usage (void) +usage (FILE *out) { command_t *command; unsigned int i; -fprintf (stderr, "Usage: notmuch [args...]\n"); -fprintf (stderr, "\n"); -fprintf (stderr, "Where and [args...] are as follows:\n"); -fprintf (stderr, "\n"); +fprintf (out, "Usage: notmuch [args...]\n"); +fprintf (out, "\n"); +fprintf (out, "Where and [args...] are as follows:\n"); +fprintf (out, "\n"); for (i = 0; i < ARRAY_SIZE (commands); i++) { command = &commands[i]; - fprintf (stderr, "\t%s\t%s\n\n", command->name, command->summary); + fprintf (out, "\t%s\t%s\n\n", command->name, command->summary); } -fprintf (stderr, "Use \"notmuch help \" for more details on each command.\n\n"); +fprintf (out, "Use \"notmuch help \" for more details on each command.\n\n"); } static int @@ -183,8 +183,8 @@ notmuch_help_command (unused (void *ctx), int argc, char *argv[]) unsigned int i; if (argc == 0) { - fprintf (stderr, "The notmuch mail system.\n\n"); - usage (); + fprintf (stdout, "The notmuch mail system.\n\n"); + usage (stdout); return 0; } -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091117/03ed852d/attachment.pgp>
[notmuch] Working with Maildir storage?
> I've also pushed a slightly more complicated (and complete) fix to my > private notmuch repository The version of lib/messages.cc in your repo doesn't build because it's missing "#include " (for the uint32_t on line 466). -- Lars Kellogg-Stedman Senior Technologist, Computing and Information Technology Harvard University School of Engineering and Applied Sciences -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091117/b069f470/attachment.pgp>
[notmuch] Working with Maildir storage?
> See the patch just posted here. Is the list archived anywhere? The obvious archives (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I think I subscribed too late to get the patch (I only just saw the discussion about it). It doesn't look like the patch is in git yet. -- Lars -- Lars Kellogg-Stedman Senior Technologist, Computing and Information Technology Harvard University School of Engineering and Applied Sciences -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091117/5bed6654/attachment.pgp>
[notmuch] Working with Maildir storage?
I saw the LWN article and decided to take a look at notmuch. I'm currently using mutt and mairix to index and read a collection of Maildir mail folders (around 40,000 messages total). notmuch indexed the messages without complaint, but my attempt at searching bombed out. Running, for example: notmuch search storage Resulted in 4604 lines of errors along the lines of: Error opening /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S: Too many open files I'm curious if this is expected behavior (i.e., notmuch does not work with Maildir) or if something else is going on. Cheers, -- Lars Kellogg-Stedman Senior Technologist, Computing and Information Technology Harvard University School of Engineering and Applied Sciences -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091117/0bc8f9bd/attachment.pgp>