From f2d59fbc0ff8e391bf9459b6933d5f00ae0533e9 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 21 Nov 2020 16:39:47 +0200 Subject: [PATCH] cmd/v: make `echo ...|v` same as `echo ...|v run -` (#6899) --- cmd/v/v.v | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/v/v.v b/cmd/v/v.v index 8738395ad0..da87f5cdb8 100644 --- a/cmd/v/v.v +++ b/cmd/v/v.v @@ -40,8 +40,14 @@ fn main() { // args = 123 if args.len == 0 || args[0] in ['-', 'repl'] { // Running `./v` without args launches repl - if args.len == 0 && is_atty(0) != 0 { - println('Welcome to the V REPL (for help with V itself, type `exit`, then run `v help`).') + 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`).') + } 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..]) return