mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: array init: []string
=> []string{}
This commit is contained in:
@@ -5,7 +5,7 @@ module cmdline
|
||||
// param: '-d'
|
||||
// ret: ['aa', 'bb', 'cc']
|
||||
pub fn options(args []string, param string) []string {
|
||||
mut flags := []string
|
||||
mut flags := []string{}
|
||||
for i, v in args {
|
||||
if v == param {
|
||||
if i + 1 < args.len {
|
||||
@@ -39,7 +39,7 @@ pub fn option(args []string, param string, def string) string {
|
||||
// what: ['test']
|
||||
// ret: ['-stat']
|
||||
pub fn options_before(args []string, what []string) []string {
|
||||
mut args_before := []string
|
||||
mut args_before := []string {}
|
||||
for a in args {
|
||||
if a in what {
|
||||
break
|
||||
@@ -55,7 +55,7 @@ pub fn options_before(args []string, what []string) []string {
|
||||
// ret: ['aaa.v']
|
||||
pub fn options_after(args []string, what []string) []string {
|
||||
mut found := false
|
||||
mut args_after := []string
|
||||
mut args_after := []string{}
|
||||
for a in args {
|
||||
if a in what {
|
||||
found = true
|
||||
|
Reference in New Issue
Block a user