File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ def __call__(
145145
146146def _parse_additional_config (unknown_args : Sequence [str ]) -> TAdditionalCliArgs :
147147 for arg in unknown_args :
148- if not re .match (r"^--[a-zA-Z\-]*? =\S*?$" , arg ):
148+ if not re .match (r"^--[a-zA-Z][a-zA-Z0-9 \-]*=\S*?$" , arg ):
149149 raise ValueError (f"Parsing argument { arg } failed" )
150150
151151 def _split_arg (_arg : str ) -> Tuple [str , str ]:
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ def test_parse_additional_config(self):
146146 "--receive-own-messages=True" ,
147147 "--false-boolean=False" ,
148148 "--offset=1.5" ,
149+ "--tseg1-abr=127" ,
149150 ]
150151 parsed_args = can .logger ._parse_additional_config (unknown_args )
151152
@@ -170,6 +171,9 @@ def test_parse_additional_config(self):
170171 assert "offset" in parsed_args
171172 assert parsed_args ["offset" ] == 1.5
172173
174+ assert "tseg1_abr" in parsed_args
175+ assert parsed_args ["tseg1_abr" ] == 127
176+
173177 with pytest .raises (ValueError ):
174178 can .logger ._parse_additional_config (["--wrong-format" ])
175179
You can’t perform that action at this time.
0 commit comments