docs: fix errors in docs.md (#9118)

pull/9119/head
JalonSolov 2021-03-04 14:52:55 -05:00 committed by GitHub
parent cc7a1f47c9
commit 814998ec10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 9 deletions

View File

@ -194,16 +194,16 @@ println('hello world')
Suppose you have a folder with several .v files in it, where one of them Suppose you have a folder with several .v files in it, where one of them
contains your `main()` function, and the other files have other helper contains your `main()` function, and the other files have other helper
functions, perhaps organized by topics, but still *not yet* structured functions. The may be organized by topic, but still *not yet* structured
enough, to be their own separate reusable modules, and you want to compile enough to be their own separate reusable modules, and you want to compile
them all into one program. them all into one program.
In other languages, you would have to use includes or a build system, In other languages, you would have to use includes or a build system
to enumerate all files, compile them separately to object files, to enumerate all files, compile them separately to object files,
then link them into one final executable. then link them into one final executable.
In V however, you can compile and run the whole folder of .v files together, In V however, you can compile and run the whole folder of .v files together,
using just: `v .` and `v run .` . Passing parameters also works, so you can using just `v run .`. Passing parameters also works, so you can
do: `v run . --yourparam some_other_stuff` do: `v run . --yourparam some_other_stuff`
The above will first compile your files into a single program (named The above will first compile your files into a single program (named
@ -216,15 +216,13 @@ import os
println(os.args) println(os.args)
``` ```
NB: after a successful run, V will delete the generated executable.
NB: after a successfull run, `v run .` will delete the generated executable.
If you want to keep it, use `v -keepc run .` instead, or just compile If you want to keep it, use `v -keepc run .` instead, or just compile
manually with `v .` . manually with `v .` .
NB: any V compiler flags should be passed *before* the `run` command, NB: any V compiler flags should be passed *before* the `run` command.
Everything after the source file/folder, will be passed to the program Everything after the source file/folder, will be passed to the program
as is, it will not be processed by V. as is - it will not be processed by V.
## Comments ## Comments