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

fix v_command()

This commit is contained in:
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) {
match command {
'', '.', 'run' {
return
}
'version' {
println('V $compiler.Version $compiler.vhash()')
return
}
'help' {
println(compiler.help_text)
return
}
'translate' {
println('Translating C to V will be available in V 0.3 (January)')
return
}
'search', 'install', 'update' {
compiler.launch_tool('vpm')
}
'get' {
println('use `v install` to install modules from vpm.vlang.io ')
return
}
'symlink' {
compiler.create_symlink()
return
}
'fmt' {
compiler.vfmt(args)
return
}
'runrepl' {
compiler.launch_tool('vrepl')
return
}
'doc' {
vexe := os.executable()
@ -126,14 +119,13 @@ fn v_command(command string, args []string) {
panic(err)
}
println(txt)
exit(0)
// v.gen_doc_html_for_module(args.last())
}
else {
println('v $command: unknown command')
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() {
println('RUNNING')
args := env_vflags_and_os_args()
if v.pref.is_verbose {
println('============ running $v.out_name ============')
@ -585,6 +586,7 @@ pub fn (v V) run_compiled_executable_and_exit() {
break
}
}
println(args_after)
cmd += args_after
if v.pref.is_test {