From a721aca982b80240e2cbd6ecdac0abc7f13cccdf Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 9 Feb 2024 09:49:17 +0100 Subject: filter-param: support parameter names ending with '!' --- lib/cli.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/cli.py b/lib/cli.py index 4fd292b..436f32e 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -670,7 +670,7 @@ def add_standard_arguments(parser): ) -def parse_filter_string(filter_string): +def parse_filter_string(filter_string, parameter_names=None): if "<=" in filter_string: p, v = filter_string.split("<=") return (p, "≤", v) @@ -679,7 +679,9 @@ def parse_filter_string(filter_string): return (p, "≥", v) if "!=" in filter_string: p, v = filter_string.split("!=") - return (p, "≠", v) + if parameter_names is None or p in parameter_names: + return (p, "≠", v) + # otherwise, '!' belongs to the parameter name and is not part of the condition. for op in ("<", ">", "≤", "≥", "=", "∈", "≠"): if op in filter_string: p, v = filter_string.split(op) -- cgit v1.2.3