diff options
| author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2018-05-11 02:57:55 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2018-05-26 07:32:14 -0700 |
| commit | f32e52448b8665dbf335fd97a21b49108e05a6c0 (patch) | |
| tree | b0dc962e86d2386e3e79e854bc078057910e6bbd /status.c | |
| parent | 6a9f26b4a04e20529203938a99658516876c67f3 (diff) | |
cli: add print_status_message()
This function is a parallel to print_status_query() or
print_status_database(). Thanks to David Bremner for the suggestion!
Diffstat (limited to 'status.c')
| -rw-r--r-- | status.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -21,6 +21,26 @@ print_status_query (const char *loc, } notmuch_status_t +print_status_message (const char *loc, + const notmuch_message_t *message, + notmuch_status_t status) +{ + if (status) { + const char *msg; + notmuch_database_t *notmuch; + + fprintf (stderr, "%s: %s\n", loc, + notmuch_status_to_string (status)); + + notmuch = notmuch_message_get_database (message); + msg = notmuch_database_status_string (notmuch); + if (msg) + fputs (msg, stderr); + } + return status; +} + +notmuch_status_t print_status_database (const char *loc, const notmuch_database_t *notmuch, notmuch_status_t status) |
