X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;ds=sidebyside;f=notmuch;h=de9d7b1073c4973cc59486074e0b5c77a9a74a6d;hb=9182b97e269e510911a29c9e9c56a7c3bdd76ebf;hp=172464c10bc3009383aac01a01db4f5990281ec1;hpb=4081ed75b5e1d0315925bd2fcefb728b315f4f4b;p=notmuch diff --git a/notmuch b/notmuch index 172464c1..de9d7b10 100755 --- a/notmuch +++ b/notmuch @@ -111,6 +111,19 @@ if __name__ == '__main__': if len(sys.argv) == 2: print HELPTEXT else: print "Not implemented" + elif sys.argv[1] == 'show': + db = Database() + if len(sys.argv) == 2: + #no further search term + querystr='' + else: + #mangle arguments wrapping terms with spaces in quotes + querystr = quote_query_line(sys.argv[2:]) + logging.debug("show "+querystr) + m = Query(db,querystr).search_messages() + for msg in m: + print(msg.format_as_text()) + elif sys.argv[1] == 'new': #TODO: handle --verbose print "Not implemented." @@ -135,15 +148,16 @@ if __name__ == '__main__': querystr = quote_query_line(sys.argv[2:]) logging.debug("search-term "+querystr) db = Database() - q = Query(db,querystr) - #TODO: notmuch_query_set_sort (query, NOTMUCH_SORT_MESSAGE_ID); - m = q.search_messages() + m = Query(db,querystr).search_messages() print("\n".join([t for t in m.collect_tags()])) elif sys.argv[1] == 'dump': + #TODO: implement "dump " db = Database() - msgs = Query(db,'').search_messages() - for msg in msgs: + q = Query(db,'') + q.set_sort(Query.SORT_MESSAGE_ID) + m = q.search_messages() + for msg in m: print("%s (%s)" % (msg.get_message_id(), msg.get_tags())) else: @@ -154,27 +168,8 @@ if __name__ == '__main__': #TODO: implement """ search [options...] [...] - - Search for messages matching the given search terms. - show [...] - - Show all messages matching the search terms. - reply [options...] [...] - - Construct a reply template for a set of messages. - tag +|- [...] [--] [...] - - Add/remove tags for all messages matching the search terms. - -dump [] - - Create a plain-text dump of the tags for each message. - restore - search-tags [ [...] ] - - List all tags found in the database or matching messages. """