File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -512,6 +512,9 @@ def from_type_str(type_str) -> type:
512
512
f"Found unknown token { token !r} in command line template: { template } "
513
513
)
514
514
515
+ if option :
516
+ raise ValueError (f"Found an option without a field: { option !r} " )
517
+
515
518
remaining_pos = remaining_positions (arguments , len (arguments ) + 1 , 1 )
516
519
517
520
for argument in arguments :
Original file line number Diff line number Diff line change @@ -984,6 +984,13 @@ def test_shell_missing_executable_dynamic():
984
984
)
985
985
986
986
987
+ def test_shell_trailing_option_fail ():
988
+
989
+ with pytest .raises (ValueError , match = "Found an option without a field" ):
990
+
991
+ shell .define ("ls <directory:generic/directory> --unparameterized-option " )
992
+
993
+
987
994
def test_shell_help1 ():
988
995
989
996
Shelly = shell .define (
You can’t perform that action at this time.
0 commit comments