deprecate `v runrepl` in favour of `v repl`

pull/3483/head
Delyan Angelov 2020-01-17 15:09:26 +02:00 committed by Alexander Medvednikov
parent ccf6134beb
commit ddc04979a4
3 changed files with 15 additions and 9 deletions

14
v.v
View File

@ -8,15 +8,19 @@ import (
benchmark benchmark
os os
filepath filepath
//v.types // v.types
// time // time
) )
const ( const (
known_commands = ['run', 'build', 'version', 'doc'] known_commands = ['run', 'build', 'version', 'doc']
simple_tools = ['fmt', 'up', 'create', 'test', 'test-fmt', 'test-compiler', 'build-tools', simple_tools = ['fmt',
'bin2v', 'up',
'build-examples', 'build-vbinaries'] 'create',
'test', 'test-fmt', 'test-compiler',
'bin2v',
'repl',
'build-tools', 'build-examples', 'build-vbinaries']
) )
fn main() { fn main() {
@ -110,6 +114,8 @@ fn v_command(command string, args []string) {
compiler.create_symlink() compiler.create_symlink()
} }
'runrepl' { 'runrepl' {
//TODO: remove this after 2020/02/01
eprintln('`v runrepl` has been deprecated. Please use `v repl` instead.')
compiler.launch_tool('vrepl', 'runrepl') compiler.launch_tool('vrepl', 'runrepl')
} }
'doc' { 'doc' {

View File

@ -58,10 +58,10 @@ pub fn run_repl_file(wd string, vexec string, file string) ?string {
input_temporary_filename := 'input_temporary_filename.txt' input_temporary_filename := 'input_temporary_filename.txt'
os.write_file(input_temporary_filename, input) os.write_file(input_temporary_filename, input)
rcmd := '"$vexec" repl < $input_temporary_filename'
r := os.exec('"$vexec" runrepl < $input_temporary_filename') or { r := os.exec(rcmd) or {
os.rm(input_temporary_filename) os.rm(input_temporary_filename)
return error('Could not execute "$vexec runrepl < $input_temporary_filename" ') return error('Could not execute: $rcmd')
} }
os.rm(input_temporary_filename) os.rm(input_temporary_filename)

View File

@ -51,7 +51,7 @@ Options/commands:
-obf Obfuscate the resulting binary. -obf Obfuscate the resulting binary.
-compress Compress the resulting binary. -compress Compress the resulting binary.
- Shorthand for `v runrepl`. - Shorthand for `v repl`.
Options for debugging/troubleshooting v programs: Options for debugging/troubleshooting v programs:
-g Generate debugging information in the backtraces. Add *V* line numbers to the generated executable. -g Generate debugging information in the backtraces. Add *V* line numbers to the generated executable.
@ -69,7 +69,7 @@ Commands:
up Update V. Run `v up` at least once per day, since V development is rapid and features/bugfixes are added constantly. up Update V. Run `v up` at least once per day, since V development is rapid and features/bugfixes are added constantly.
run <file.v> Build and execute the V program in file.v. You can add arguments for the V program *after* the file name. run <file.v> Build and execute the V program in file.v. You can add arguments for the V program *after* the file name.
build <module> Compile a module into an object file. 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. repl 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. symlink Useful on Unix systems. Symlinks the current V executable to /usr/local/bin/v, so that V is globally available.
test v Run all V test files, and compile all V examples. 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. test folder/ Run all V test files located in the folder and its subfolders. You can also pass individual _test.v files too.