From b4eadb903013a4a59a41c5554c2eaa2fdab88cc2 Mon Sep 17 00:00:00 2001 From: Julia K Date: Tue, 26 May 2020 03:17:52 +0200 Subject: [PATCH] cmd/v: reimplement -path flag --- vlib/os/os_nix.c.v | 1 + vlib/os/os_windows.c.v | 1 + vlib/v/pref/pref.v | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/vlib/os/os_nix.c.v b/vlib/os/os_nix.c.v index 3971cb5bdb..0e1fb76230 100644 --- a/vlib/os/os_nix.c.v +++ b/vlib/os/os_nix.c.v @@ -8,6 +8,7 @@ import strings pub const ( path_separator = '/' + path_delimiter = ':' ) const ( diff --git a/vlib/os/os_windows.c.v b/vlib/os/os_windows.c.v index 02696f0457..228b61ed85 100644 --- a/vlib/os/os_windows.c.v +++ b/vlib/os/os_windows.c.v @@ -7,6 +7,7 @@ import strings pub const ( path_separator = '\\' + path_delimiter = ';' ) // Ref - https://docs.microsoft.com/en-us/windows/desktop/winprog/windows-data-types diff --git a/vlib/v/pref/pref.v b/vlib/v/pref/pref.v index 057f93cf9f..5175fc7abd 100644 --- a/vlib/v/pref/pref.v +++ b/vlib/v/pref/pref.v @@ -248,6 +248,11 @@ pub fn parse_args(args []string) (&Preferences, string) { res.backend = b i++ } + '-path' { + path := cmdline.option(current_args, '-path', '') + res.lookup_path = path.split(os.path_delimiter) + i++ + } else { mut should_continue := false for flag_with_param in list_of_flags_with_param {