]> git.cworth.org Git - obsolete/notmuch-to-html/blobdiff - notmuch-to-html
Revert "Drop the --get-query option"
[obsolete/notmuch-to-html] / notmuch-to-html
index 498921565379514b59e18ce83d532e8dd0d895d6..712fbb7ee2e85637fd4d6eed2c52817554d6d5c2 100755 (executable)
@@ -4,6 +4,7 @@
 # searches, (with links to gmane views of each email if available).
 #
 # Copyright (c) 2011-2012 David Bremner <david@tethera.net>
+# Copyright (c) 2014      Carl Worth <cworth@cworth.org
 #
 # dependencies
 #       - python 2.6 for json
@@ -265,6 +266,8 @@ group.add_argument('--query', help='path to configuration file',
                    metavar='PATH')
 parser.add_argument('--list-views', help='list views',
                     action='store_true')
+parser.add_argument('--get-query', help='get query for view',
+                    metavar='VIEW')
 
 args = parser.parse_args()
 
@@ -342,6 +345,11 @@ if args.list_views:
     for view in config['views']:
         print(view['title'])
     sys.exit(0)
+elif args.get_query != None:
+    for view in config['views']:
+        if args.get_query == view['title']:
+            print(' and '.join(view['query']))
+    sys.exit(0)
 else:
     # only import notmuch if needed
     import notmuch