+A new subcommand 'cat' was added, which simplifies use of Emacs
+interface with remote database (accessed over SSH).
+
Notmuch 0.2 (2010-04-16)
========================
This is the second release of the notmuch mail system, with actual
int
notmuch_search_tags_command (void *ctx, int argc, char *argv[]);
+int
+notmuch_cat_command (void *ctx, int argc, char *argv[]);
+
int
notmuch_part_command (void *ctx, int argc, char *argv[]);
return 0;
}
+int
+notmuch_cat_command (void *ctx, unused (int argc), unused (char *argv[]))
+{
+ int i;
+ FILE *file;
+ const char *filename;
+ size_t size;
+ char buf[4096];
+
+ (void)ctx;
+
+ for (i = 0; i < argc && argv[i][0] == '-'; i++) {
+ fprintf (stderr, "Unrecognized option: %s\n", argv[i]);
+ return 1;
+ }
+
+ argc -= i;
+ argv += i;
+
+ if (argc == 0) {
+ fprintf (stderr, "Error: No filename given\n");
+ return 1;
+ }
+ filename = argv[0];
+
+ file = fopen (filename, "r");
+ if (file == NULL) {
+ fprintf (stderr, "Error: Cannot open %s: %s\n", filename, strerror (errno));
+ return 1;
+ }
+ while (!feof (file)) {
+ size = fread(buf, 1, sizeof(buf), file);
+ fwrite (buf, size, 1, stdout);
+ }
+ fclose (file);
+
+ return 0;
+}
+
int
notmuch_part_command (void *ctx, unused (int argc), unused (char *argv[]))
{
"\tcontain tags only from messages that match the search-term(s).\n"
"\n"
"\tIn both cases the list will be alphabetically sorted." },
+ { "cat", notmuch_cat_command,
+ "<path>",
+ "Dump raw message identified by path to standard output.",
+ "" },
{ "part", notmuch_part_command,
"--part=<num> <search-terms>",
"Output a single MIME part of a message.",