summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-02-09 09:49:17 +0100
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-02-09 09:49:17 +0100
commita721aca982b80240e2cbd6ecdac0abc7f13cccdf (patch)
treec3db21db9fb3b3cb21a431025b2217b8340b49c7 /lib
parentcfc77a403e9487580a966669cc4be0f90d464d62 (diff)
filter-param: support parameter names ending with '!'
Diffstat (limited to 'lib')
-rw-r--r--lib/cli.py6
1 files changed, 4 insertions, 2 deletions
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)