diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-02-09 09:49:17 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-02-09 09:49:17 +0100 |
commit | a721aca982b80240e2cbd6ecdac0abc7f13cccdf (patch) | |
tree | c3db21db9fb3b3cb21a431025b2217b8340b49c7 /lib | |
parent | cfc77a403e9487580a966669cc4be0f90d464d62 (diff) |
filter-param: support parameter names ending with '!'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cli.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) |