From fac258e5f32cbf1cb84d32d29e8eeb67deae0641 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Tue, 2 Jun 2020 09:55:11 -0700 Subject: [PATCH] Add filters to deactivate --- inquisitor/cli.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inquisitor/cli.py b/inquisitor/cli.py index 2ce19f0..416c393 100644 --- a/inquisitor/cli.py +++ b/inquisitor/cli.py @@ -44,6 +44,10 @@ def command_deactivate(args): parser.add_argument("source", nargs="*", help="Cells to deactivate.") + parser.add_argument("--tag", + help="Only deactivate items with this tag") + parser.add_argument("--title", + help="Only deactivate items with titles containing this substring") args = parser.parse_args(args) if len(args.source) == 0: @@ -62,6 +66,10 @@ def command_deactivate(args): count = 0 items, _ = load_items(source_name) for item in items.values(): + if args.tag and args.tag not in item['tags']: + continue + if args.title and args.title not in item['title']: + continue if item['active']: item['active'] = False count += 1