fix v_command()

pull/3091/head
Alexander Medvednikov 2019-12-15 05:44:34 +03:00
parent 12ebed0589
commit 68357876ca
2 changed files with 4 additions and 10 deletions

12
v.v
View File

@ -83,38 +83,31 @@ fn main() {
fn v_command(command string, args []string) { fn v_command(command string, args []string) {
match command { match command {
'', '.', 'run' { '', '.', 'run' {
return
} }
'version' { 'version' {
println('V $compiler.Version $compiler.vhash()') println('V $compiler.Version $compiler.vhash()')
return
} }
'help' { 'help' {
println(compiler.help_text) println(compiler.help_text)
return
} }
'translate' { 'translate' {
println('Translating C to V will be available in V 0.3 (January)') println('Translating C to V will be available in V 0.3 (January)')
return
} }
'search', 'install', 'update' { 'search', 'install', 'update' {
compiler.launch_tool('vpm') compiler.launch_tool('vpm')
} }
'get' { 'get' {
println('use `v install` to install modules from vpm.vlang.io ') println('use `v install` to install modules from vpm.vlang.io ')
return
} }
'symlink' { 'symlink' {
compiler.create_symlink() compiler.create_symlink()
return
} }
'fmt' { 'fmt' {
compiler.vfmt(args) compiler.vfmt(args)
return
} }
'runrepl' { 'runrepl' {
compiler.launch_tool('vrepl') compiler.launch_tool('vrepl')
return
} }
'doc' { 'doc' {
vexe := os.executable() vexe := os.executable()
@ -126,14 +119,13 @@ fn v_command(command string, args []string) {
panic(err) panic(err)
} }
println(txt) println(txt)
exit(0)
// v.gen_doc_html_for_module(args.last()) // v.gen_doc_html_for_module(args.last())
} }
else { else {
println('v $command: unknown command') println('v $command: unknown command')
println('Run "v help" for usage.') println('Run "v help" for usage.')
return
} }
} }
exit(0)
} }

View File

@ -570,6 +570,7 @@ pub fn final_target_out_name(out_name string) string {
} }
pub fn (v V) run_compiled_executable_and_exit() { pub fn (v V) run_compiled_executable_and_exit() {
println('RUNNING')
args := env_vflags_and_os_args() args := env_vflags_and_os_args()
if v.pref.is_verbose { if v.pref.is_verbose {
println('============ running $v.out_name ============') println('============ running $v.out_name ============')
@ -585,6 +586,7 @@ pub fn (v V) run_compiled_executable_and_exit() {
break break
} }
} }
println(args_after)
cmd += args_after cmd += args_after
if v.pref.is_test { if v.pref.is_test {