]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch
implement Query.set_sort() and sort notmuch dump by message id
[notmuch] / notmuch
diff --git a/notmuch b/notmuch
index 56f961b47d581f68172d2e9114b9190d6ff7a10d..478aed3ab0108fd79fac1d524fbcf03623b68e42 100755 (executable)
--- a/notmuch
+++ b/notmuch
@@ -138,6 +138,15 @@ if __name__ == '__main__':
          m  = Query(db,querystr).search_messages()
          print("\n".join([t for t in m.collect_tags()]))
 
+   elif sys.argv[1] == 'dump':
+      #TODO: implement "dump <filename>"
+      db = Database()
+      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:
        # unknown command
        print "Error: Unknown command '%s' (see \"notmuch help\")" % sys.argv[1]
@@ -153,10 +162,6 @@ show       <search-terms> [...]
 
        Show all messages matching the search terms.
 
-count  <search-terms> [...]
-
-       Count messages matching the search terms.
-
 reply  [options...] <search-terms> [...]
 
        Construct a reply template for a set of messages.