Skip to content

Commit ebac3be

Browse files
committed
pref: pass -v after a command, to the command only, do not set verbose mode on
1 parent a608516 commit ebac3be

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vlib/v/pref/pref.v

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
237237
}
238238
res.run_only = os.getenv('VTEST_ONLY_FN').split_any(',')
239239
mut command := ''
240-
mut command_pos := 0
240+
mut command_pos := -1
241241
// for i, arg in args {
242242
for i := 0; i < args.len; i++ {
243243
arg := args[i]
@@ -289,6 +289,10 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
289289
res.is_help = true
290290
}
291291
'-v' {
292+
if command_pos != -1 {
293+
// a -v flag after the command, is intended for the command, not for V itself
294+
continue
295+
}
292296
// `-v` flag is for setting verbosity, but without any args it prints the version, like Clang
293297
if args.len > 1 {
294298
res.is_verbose = true

0 commit comments

Comments
 (0)