diff --git a/tests/TestHarness/launcher.py b/tests/TestHarness/launcher.py index e66f0ea64a..cfe1a4f37c 100644 --- a/tests/TestHarness/launcher.py +++ b/tests/TestHarness/launcher.py @@ -16,6 +16,10 @@ block_dir = 'blocks' +def _is_command_option(token): + """Return whether a command-line token is an option name rather than an option value.""" + return token.startswith('--') + class EnhancedEncoder(json.JSONEncoder): def default(self, o): if is_dataclass(o): @@ -575,7 +579,7 @@ def construct_command_line(self, instance: nodeDefinition): if '-' in arg and arg not in repeatable: if arg in sysdcmd: i = sysdcmd.index(arg) - if sysdcmd[i+1] != '-': + if i + 1 < len(sysdcmd) and not _is_command_option(sysdcmd[i+1]): sysdcmd.pop(i+1) sysdcmd.pop(i) sysdcmd.extend(specificList)