utils: add args to launch_tool
parent
28ffe2a6ee
commit
7e538d7401
|
@ -36,7 +36,7 @@ fn main_v() {
|
||||||
if args.len == 0 {
|
if args.len == 0 {
|
||||||
println('For usage information, quit V REPL using `exit` and use `v help`')
|
println('For usage information, quit V REPL using `exit` and use `v help`')
|
||||||
}
|
}
|
||||||
util.launch_tool(false, 'vrepl')
|
util.launch_tool(false, 'vrepl', os.args[1..])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
args_and_flags := util.join_env_vflags_and_os_args()[1..]
|
args_and_flags := util.join_env_vflags_and_os_args()[1..]
|
||||||
|
@ -61,7 +61,7 @@ fn main_v() {
|
||||||
// Note for future contributors: Please add new subcommands in the `match` block below.
|
// Note for future contributors: Please add new subcommands in the `match` block below.
|
||||||
if command in simple_cmd {
|
if command in simple_cmd {
|
||||||
// External tools
|
// External tools
|
||||||
util.launch_tool(prefs.is_verbose, 'v' + command)
|
util.launch_tool(prefs.is_verbose, 'v' + command, os.args[1..])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
match command {
|
match command {
|
||||||
|
@ -69,7 +69,7 @@ fn main_v() {
|
||||||
invoke_help_and_exit(args)
|
invoke_help_and_exit(args)
|
||||||
}
|
}
|
||||||
'new', 'init' {
|
'new', 'init' {
|
||||||
util.launch_tool(prefs.is_verbose, 'vcreate')
|
util.launch_tool(prefs.is_verbose, 'vcreate', os.args[1..])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
'translate' {
|
'translate' {
|
||||||
|
@ -77,7 +77,7 @@ fn main_v() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
'search', 'install', 'update', 'remove' {
|
'search', 'install', 'update', 'remove' {
|
||||||
util.launch_tool(prefs.is_verbose, 'vpm')
|
util.launch_tool(prefs.is_verbose, 'vpm', os.args[1..])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
'get' {
|
'get' {
|
||||||
|
|
|
@ -102,11 +102,11 @@ pub fn set_vroot_folder(vroot_path string) {
|
||||||
os.setenv('VEXE', os.real_path(os.join_path(vroot_path, vname)), true)
|
os.setenv('VEXE', os.real_path(os.join_path(vroot_path, vname)), true)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn launch_tool(is_verbose bool, tool_name string) {
|
pub fn launch_tool(is_verbose bool, tool_name string, args []string) {
|
||||||
vexe := pref.vexe_path()
|
vexe := pref.vexe_path()
|
||||||
vroot := os.dir(vexe)
|
vroot := os.dir(vexe)
|
||||||
set_vroot_folder(vroot)
|
set_vroot_folder(vroot)
|
||||||
tool_args := args_quote_paths_with_spaces(os.args[1..])
|
tool_args := args_quote_paths_with_spaces(args)
|
||||||
tool_exe := path_of_executable(os.real_path('$vroot/cmd/tools/$tool_name'))
|
tool_exe := path_of_executable(os.real_path('$vroot/cmd/tools/$tool_name'))
|
||||||
tool_source := os.real_path('$vroot/cmd/tools/${tool_name}.v')
|
tool_source := os.real_path('$vroot/cmd/tools/${tool_name}.v')
|
||||||
tool_command := '"$tool_exe" $tool_args'
|
tool_command := '"$tool_exe" $tool_args'
|
||||||
|
|
Loading…
Reference in New Issue