From 4bade9bceab7ba045e8bc18f12b5fd0e6eda8778 Mon Sep 17 00:00:00 2001 From: lutherwenxu Date: Sat, 4 Apr 2020 18:09:34 +0800 Subject: [PATCH] cmd/v: fix argument parsing --- cmd/v/v.v | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cmd/v/v.v b/cmd/v/v.v index b0efa46df0..146e242dd7 100644 --- a/cmd/v/v.v +++ b/cmd/v/v.v @@ -121,10 +121,18 @@ fn parse_args(args []string) (&pref.Preferences, string) { res.out_name = cmdline.option(args, '-o', '') i++ } - '-csource', '-backend' { - i++ // TODO - } else { + mut should_continue := false + for flag_with_param in list_of_flags_with_param { + if '-$flag_with_param' == arg { + should_continue = true + i++ + break + } + } + if should_continue { + continue + } if !arg.starts_with('-') && command == '' { command = arg }