vself: fix command line args (#11072)

pull/11079/head
yuyi 2021-08-06 11:21:00 +08:00 committed by GitHub
parent 91ade5bf8c
commit b95224aa20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -13,8 +13,7 @@ fn main() {
recompilation.must_be_enabled(vroot, 'Please install V from source, to use `v self` .') recompilation.must_be_enabled(vroot, 'Please install V from source, to use `v self` .')
os.chdir(vroot) os.chdir(vroot)
os.setenv('VCOLORS', 'always', true) os.setenv('VCOLORS', 'always', true)
self_idx := os.args.index('self') args := os.args[1..].filter(it != 'self')
args := os.args[1..self_idx]
jargs := args.join(' ') jargs := args.join(' ')
obinary := cmdline.option(args, '-o', '') obinary := cmdline.option(args, '-o', '')
sargs := if obinary != '' { jargs } else { '$jargs -o v2' } sargs := if obinary != '' { jargs } else { '$jargs -o v2' }