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

cmd/v: make echo ...|v same as echo ...|v run - (#6899)

This commit is contained in:
Delyan Angelov 2020-11-21 16:39:47 +02:00 committed by GitHub
parent 155aa6dac5
commit f2d59fbc0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,8 +40,14 @@ fn main() {
// args = 123 // args = 123
if args.len == 0 || args[0] in ['-', 'repl'] { if args.len == 0 || args[0] in ['-', 'repl'] {
// Running `./v` without args launches repl // Running `./v` without args launches repl
if args.len == 0 && is_atty(0) != 0 { if args.len == 0 {
if is_atty(0) != 0 {
println('Welcome to the V REPL (for help with V itself, type `exit`, then run `v help`).') println('Welcome to the V REPL (for help with V itself, type `exit`, then run `v help`).')
} else {
mut args_and_flags := util.join_env_vflags_and_os_args()[1..].clone()
args_and_flags << ['run', '-']
pref.parse_args(args_and_flags)
}
} }
util.launch_tool(false, 'vrepl', os.args[1..]) util.launch_tool(false, 'vrepl', os.args[1..])
return return