pref: pass -v after a command, to the command only, do not set verbose mode on

Delyan Angelov 2022-05-18 07:03:00 +03:00 committed by Jef Roosens
parent 84c1f642f5
commit 055c33e2ca
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
1 changed files with 5 additions and 1 deletions

View File

@ -237,7 +237,7 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
} }
res.run_only = os.getenv('VTEST_ONLY_FN').split_any(',') res.run_only = os.getenv('VTEST_ONLY_FN').split_any(',')
mut command := '' mut command := ''
mut command_pos := 0 mut command_pos := -1
// for i, arg in args { // for i, arg in args {
for i := 0; i < args.len; i++ { for i := 0; i < args.len; i++ {
arg := args[i] arg := args[i]
@ -289,6 +289,10 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
res.is_help = true res.is_help = true
} }
'-v' { '-v' {
if command_pos != -1 {
// a -v flag after the command, is intended for the command, not for V itself
continue
}
// `-v` flag is for setting verbosity, but without any args it prints the version, like Clang // `-v` flag is for setting verbosity, but without any args it prints the version, like Clang
if args.len > 1 { if args.len > 1 {
res.is_verbose = true res.is_verbose = true