Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pydra/compose/shell/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,9 @@
f"Found unknown token {token!r} in command line template: {template}"
)

if option:
raise ValueError(f"Found an option without a field: {option!r}")

Check warning on line 516 in pydra/compose/shell/builder.py

View check run for this annotation

Codecov / codecov/patch

pydra/compose/shell/builder.py#L516

Added line #L516 was not covered by tests

remaining_pos = remaining_positions(arguments, len(arguments) + 1, 1)

for argument in arguments:
Expand Down
7 changes: 7 additions & 0 deletions pydra/compose/shell/tests/test_shell_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,13 @@ def test_shell_missing_executable_dynamic():
)


def test_shell_trailing_option_fail():

with pytest.raises(ValueError, match="Found an option without a field"):

shell.define("ls <directory:generic/directory> --unparameterized-option ")


def test_shell_help1():

Shelly = shell.define(
Expand Down
Loading