cmd/v: reimplement -path flag

pull/5049/head
Julia K 2020-05-26 03:17:52 +02:00 committed by GitHub
parent b1bbb17254
commit b4eadb9030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import strings
pub const (
path_separator = '/'
path_delimiter = ':'
)
const (

View File

@ -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

View File

@ -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 {