v: support `-o - x_test.v` too, describe `-o -` in the `v help` screen

pull/10858/head
Delyan Angelov 2021-07-18 16:34:47 +03:00
parent a007dd5d22
commit 016240d00b
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 4 additions and 0 deletions

View File

@ -8,6 +8,7 @@ Examples:
v run hello.v Same as above but also run the produced executable immediately after compilation. 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 -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 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. v watch hello.v Re-does the same compilation, when a source code change is detected.
The program is only compiled, not run. The program is only compiled, not run.

View File

@ -107,6 +107,9 @@ fn (mut b Builder) run_compiled_executable_and_exit() {
if b.pref.only_check_syntax { if b.pref.only_check_syntax {
return return
} }
if b.pref.out_name.ends_with('/-') {
return
}
if b.pref.os == .ios { if b.pref.os == .ios {
panic('Running iOS apps is not supported yet.') panic('Running iOS apps is not supported yet.')
} }