Skip to content

Commit 55c30c1

Browse files
committed
fixed up bug in command line parsing, recognise '-' in option flags
1 parent 65a5e68 commit 55c30c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pydra/compose/shell/builder.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def parse_command_line_template(
350350
if not tokens:
351351
return executable, inputs, outputs
352352
arg_pattern = r"<([:a-zA-Z0-9_,\|\-\.\/\+\*]+(?:\?|(?:=|\$)[^>]+)?)>"
353-
opt_pattern = r"--?[a-zA-Z0-9_]+"
353+
opt_pattern = r"--?[a-zA-Z0-9_\-]+"
354354
arg_re = re.compile(arg_pattern)
355355
opt_re = re.compile(opt_pattern)
356356
bool_arg_re = re.compile(f"({opt_pattern}){arg_pattern}")
@@ -505,6 +505,7 @@ def from_type_str(type_str) -> type:
505505
add_arg(
506506
var, field.arg, {"type": bool, "argstr": argstr, "default": default}
507507
)
508+
option = None
508509
elif match := opt_re.match(token):
509510
option = token
510511
else:

0 commit comments

Comments
 (0)