]> git.notmuchmail.org Git - notmuch/commit
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)
commit5fdce046a189f6232c1bd2f89a6df04e02b226f0
tree7a427d35ed0c643aed95e41dfbb325fced9dd647
parentec738509f291fb6563013cc530d7930cfe6495fb
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
notmuch-new.c
notmuch.c