File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -962,12 +962,11 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
962
962
// arguments for e.g. fmt should be checked elsewhere
963
963
continue
964
964
}
965
- if res.is_vsh && command_idx < i {
966
- // Allow for `script.vsh abc 123 -option`, because -option is for the .vsh program, not for v
967
- continue
968
- }
969
- if command == 'doc' {
970
- // Allow for `v doc -comments file.v`
965
+ if command_idx < i && (res.is_vsh || (is_source_file (command)
966
+ && command in known_external_commands)) {
967
+ // When running programs, let them be responsible for the arguments passed to them.
968
+ // E.g.: `script.vsh cmd -opt` or `v run hello_world.v -opt`.
969
+ // But detect unknown arguments when building them. E.g.: `v hello_world.v -opt`.
971
970
continue
972
971
}
973
972
err_detail := if command == '' { '' } else { ' for command `${command} `' }
You can’t perform that action at this time.
0 commit comments