pref: fix conflict (#21382)

This commit is contained in:
Turiiya 2024-04-29 19:59:57 +02:00 committed by GitHub
parent e4bbd73da3
commit a1bb84f455
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -402,7 +402,7 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
'-v', '-V', '--version', '-version' {
if command_pos == -1 {
// Version flags after a command are intended for the command, not for V itself.
if current_args.len > 1 && arg == '-v' {
if args[i..].len > 1 && arg == '-v' {
// With additional args after the `-v` flag, it toggles verbosity, like Clang.
// E.g.: `v -v` VS `v -v run examples/hello_world.v`.
res.is_verbose = true