added arguments handling for run

pull/1049/head
Henrixounez 2019-06-26 14:13:02 +02:00 committed by Alex Medvednikov
parent 6a0ac35af2
commit f0e6a1c1c1
1 changed files with 7 additions and 1 deletions

View File

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