From 016240d00be5a6efc52ce3691a14ea3af3fd02ca Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 18 Jul 2021 16:34:47 +0300 Subject: [PATCH] v: support `-o - x_test.v` too, describe `-o -` in the `v help` screen --- cmd/v/help/default.txt | 1 + vlib/v/builder/compile.v | 3 +++ 2 files changed, 4 insertions(+) diff --git a/cmd/v/help/default.txt b/cmd/v/help/default.txt index ca9553ee79..dfa5c12ecf 100644 --- a/cmd/v/help/default.txt +++ b/cmd/v/help/default.txt @@ -8,6 +8,7 @@ Examples: v run hello.v Same as above but also run the produced executable immediately after compilation. v -cg run hello.v Same as above, but make debugging easier (in case your program crashes). v -o h.c hello.v Translate `hello.v` to `h.c`. Do not compile further. + v -o - hello.v Translate `hello.v` and output the C source code to stdout. Do not compile further. v watch hello.v Re-does the same compilation, when a source code change is detected. The program is only compiled, not run. diff --git a/vlib/v/builder/compile.v b/vlib/v/builder/compile.v index dacd9b9216..cda440efb9 100644 --- a/vlib/v/builder/compile.v +++ b/vlib/v/builder/compile.v @@ -107,6 +107,9 @@ fn (mut b Builder) run_compiled_executable_and_exit() { if b.pref.only_check_syntax { return } + if b.pref.out_name.ends_with('/-') { + return + } if b.pref.os == .ios { panic('Running iOS apps is not supported yet.') }