X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch;h=56f961b47d581f68172d2e9114b9190d6ff7a10d;hp=6f002aac749434f686257d58f692dcf113a3410c;hb=3b2d73c684501e2eb906542f5081125d4e9c485d;hpb=d099b79fd1c4d1248a3221c9994be51bbff898e8 diff --git a/notmuch b/notmuch index 6f002aac..56f961b4 100755 --- a/notmuch +++ b/notmuch @@ -115,6 +115,17 @@ if __name__ == '__main__': #TODO: handle --verbose print "Not implemented." + elif sys.argv[1] == 'count': + 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("count "+querystr) + print(len(Query(db,querystr).search_messages())) + elif sys.argv[1] == 'search-tags': if len(sys.argv) == 2: #no further search term