1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

added arguments handling for run

This commit is contained in:
Henrixounez 2019-06-26 14:13:02 +02:00 committed by Alex Medvednikov
parent 6a0ac35af2
commit f0e6a1c1c1

View File

@ -380,12 +380,15 @@ string _STR_TMP(const char *fmt, ...) {
if true || c.is_verbose {
println('============running $c.out_name==============================')
}
cmd := if c.out_name.starts_with('/') {
mut cmd := if c.out_name.starts_with('/') {
c.out_name
}
else {
'./' + c.out_name
}
if os.args.len > 3 {
cmd += ' ' + os.args.right(3).join(' ')
}
ret := os.system2(cmd)
if ret != 0 {
s := os.system(cmd)
@ -687,6 +690,9 @@ fn (c &V) log(s string) {
fn new_v(args[]string) *V {
mut dir := args.last()
if args.contains('run') {
dir = args[2]
}
// println('new compiler "$dir"')
if args.len < 2 {
dir = ''