Skip to content

Commit

Permalink
further improve fix to handle -v version/verbosity toggle with vfla…
Browse files Browse the repository at this point in the history
…gs like `-cc gcc -v`
  • Loading branch information
ttytm committed Apr 29, 2024
1 parent 2f2d238 commit 230ef8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/pref/pref.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,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 args.len > 1 && arg == '-v' {
if current_args.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
Expand Down

0 comments on commit 230ef8a

Please sign in to comment.