From: Carl Worth Date: Wed, 23 Apr 2014 07:32:39 +0000 (-0700) Subject: Revert "Drop the --get-query option" X-Git-Url: https://git.cworth.org/git?p=obsolete%2Fnotmuch-to-html;a=commitdiff_plain Revert "Drop the --get-query option" 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). --- diff --git a/notmuch-to-html b/notmuch-to-html index 0d0831f..712fbb7 100755 --- a/notmuch-to-html +++ b/notmuch-to-html @@ -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