]> git.notmuchmail.org Git - notmuch/commitdiff
Support for printing file paths in new command
authorAdrian Perez <aperez@igalia.com>
Sat, 21 Nov 2009 00:17:18 +0000 (01:17 +0100)
committerCarl Worth <cworth@cworth.org>
Mon, 23 Nov 2009 00:07:02 +0000 (01:07 +0100)
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.


No differences found