aboutsummaryrefslogtreecommitdiff
path: root/notmuch.c
diff options
context:
space:
mode:
authorDavid Edmondson <dme@dme.org>2010-03-24 07:21:20 +0000
committerDavid Edmondson <dme@dme.org>2010-04-02 09:43:03 +0100
commit2e9c7aba99598eafd7b5fc52897da14ea13af216 (patch)
tree51a832c9dd92319c81735db321d35e13018ccb79 /notmuch.c
parent930a47935fcd87ff4ae6c0c14279fd136f5bd78b (diff)
notmuch: Add a 'part' subcommand
A new 'part' subcommand allows the user to extract a single part from a MIME message. Usage: notmuch part --part=<n> <search terms> The search terms must match only a single message (e.g. id:foo@bar.com). The part number specified refers to the part identifiers output by `notmuch show'. The content of the part is written the stdout with no formatting or identification marks. It is not JSON formatted.
Diffstat (limited to 'notmuch.c')
-rw-r--r--notmuch.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/notmuch.c b/notmuch.c
index 95f057e..6ebe36d 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -294,6 +294,17 @@ command_t commands[] = {
"\t\tcontain tags only from messages that match the search-term(s).\n"
"\n"
"\t\tIn both cases the list will be alphabetically sorted." },
+ { "part", notmuch_part_command,
+ "--part=<num> <search-terms>",
+ "\t\tOutput a single MIME part of a message.",
+ "\t\tA single decoded MIME part, with no encoding or framing,\n"
+ "\t\tis output to stdout. The search terms must match only a single\n"
+ "\t\tmessage, otherwise this command will fail.\n"
+ "\n"
+ "\t\tThe part number should match the part \"id\" field output\n"
+ "\t\tby the \"--format=json\" option of \"notmuch show\". If the\n"
+ "\t\tmessage specified by the search terms does not include a\n"
+ "\t\tpart with the specified \"id\" there will be no output." },
{ "help", notmuch_help_command,
"[<command>]",
"\t\tThis message, or more detailed help for the named command.",