]> git.cworth.org Git - obsolete/notmuch-to-html/commitdiff
Revert "Drop the --get-query option" master
authorCarl Worth <cworth@cworth.org>
Wed, 23 Apr 2014 07:32:39 +0000 (00:32 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 23 Apr 2014 07:32:39 +0000 (00:32 -0700)
This reverts commit f55ff7e7dcea67f544050c4a9508b3d1764d7c69.

Jani and Walter convinced me that this functionality is actually
useful, (to avoid replicating much of the logic of this script in
calling scripts).

notmuch-to-html

index 0d0831f3fd8a9746d388087eea5801b30a4e47b5..712fbb7ee2e85637fd4d6eed2c52817554d6d5c2 100755 (executable)
@@ -266,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()
 
@@ -343,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