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

tools/vget => tools/v , search, install, etc

* compiler: rename vget to tools/vpm, implement draft support for v vpm search, v vpm update, v vpm install, v vpm remove, v vpm help .

* compiler: use "v pm" instead of "v vpm" to reduce the redundancy of typing, as suggested by slapden


* Use 'v install modulename', 'v search keywords', 'v update modulename', 'v remove modulename' instead of the longer 'v pm install modulename' etc.
This commit is contained in:
Delyan Angelov
2019-11-01 14:19:04 +02:00
committed by Alexander Medvednikov
parent a83e233dea
commit 59efd42483
8 changed files with 228 additions and 173 deletions

View File

@@ -993,54 +993,6 @@ pub fn vfmt(args[]string) {
println('vfmt is temporarily disabled')
}
pub fn install_v(args[]string) {
if args.len < 3 {
println('usage: v install [module] [module] [...]')
return
}
names := args.slice(2, args.len)
vexec := vexe_path()
vroot := os.dir(vexec)
vget := '$vroot/tools/vget'
if true {
//println('Building vget...')
os.chdir(vroot + '/tools')
vget_compilation := os.exec('"$vexec" -o $vget vget.v') or {
verror(err)
return
}
if vget_compilation.exit_code != 0 {
verror( vget_compilation.output )
return
}
}
vgetresult := os.exec('$vget ' + names.join(' ')) or {
verror(err)
return
}
if vgetresult.exit_code != 0 {
verror( vgetresult.output )
return
}
}
pub fn run_repl() {
vexec := vexe_path()
vroot := os.dir(vexec)
vrepl := '$vroot/tools/vrepl'
os.chdir(vroot + '/tools')
vrepl_compilation := os.exec('"$vexec" -o $vrepl vrepl.v') or {
verror(err)
return
}
if vrepl_compilation.exit_code != 0 {
verror(vrepl_compilation.output)
return
}
vreplresult := os.system('$vrepl "$vexec"')
}
pub fn create_symlink() {
vexe := vexe_path()
link_path := '/usr/local/bin/v'

View File

@@ -66,12 +66,17 @@ Commands:
build <module> Compile a module into an object file.
runrepl Run the V REPL. If V is running in a tty terminal, the REPL is interactive, otherwise it just reads from stdin.
symlink Useful on Unix systems. Symlinks the current V executable to /usr/local/bin/v, so that V is globally available.
install <module> Install a user module from https://vpm.vlang.io/.
test v Run all V test files, and compile all V examples.
test folder/ Run all V test files located in the folder and its subfolders. You can also pass individual _test.v files too.
fmt Run vfmt to format the source code. [wip]
doc Run vdoc over the source code and produce documentation.
translate Translates C to V. [wip, will be available in V 0.3]
V package management commands:
search keywords Search the https://vpm.vlang.io/ module repository for matching modules and shows their details.
install <module> Install a user module from https://vpm.vlang.io/.
update [module] Updates an already installed module, or ALL installed modules at once, when no module name is given.
remove [module] Removes an installed module, or ALL installed modules at once, when no module name is given.
'
)