From 5fdce046a189f6232c1bd2f89a6df04e02b226f0 Mon Sep 17 00:00:00 2001 From: Adrian Perez Date: Sat, 21 Nov 2009 01:17:18 +0100 Subject: Support for printing file paths in new command For very large mail boxes, it is desirable to know which files are being processed e.g. when a crash occurs to know which one was the cause. Also, it may be interesting to have a better idea of how the operation is progressing when processing mailboxes with big messages. This patch adds support for printing messages as they are processed by "notmuch new": * The "new" command now supports a "--verbose" flag. * When running in verbose mode, the file path of the message about to be processed is printed in the following format: current/total: /path/to/message/file Where "current" is the number of messages processed so far and "total" is the total count of files to be processed. The status line is erased using an ANSI sequence "\033[K" (erase current line from the cursor to the end of line) each time it is refreshed. This should not pose a problem because nearly every terminal supports it. * The signal handler for SIGALRM and the timer are not enabled when running in verbose mode, because we are already printing progress with each file, periodical reports are not neccessary. --- notmuch-client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'notmuch-client.h') diff --git a/notmuch-client.h b/notmuch-client.h index ea776860..f105c8b2 100644 --- a/notmuch-client.h +++ b/notmuch-client.h @@ -74,6 +74,7 @@ typedef void (*add_files_callback_t) (notmuch_message_t *message); typedef struct { int ignore_read_only_directories; int saw_read_only_directory; + int verbose; int total_files; int processed_files; -- cgit v1.2.3