help: update help .txt files

pull/4587/head
Delyan Angelov 2020-04-25 11:15:51 +03:00
parent e0ab318f56
commit 1863dda8e5
3 changed files with 32 additions and 26 deletions

View File

@ -11,27 +11,32 @@ These build flags are enabled on `build` and `run` as long as the backend is set
Change the architecture that V will tell the C compiler to build. Change the architecture that V will tell the C compiler to build.
List of supported architectures: `x86` and `x64` (default). List of supported architectures: `x86` and `x64` (default).
-cc <compiler>, -compiler <compiler> -cc <compiler>
Change the C compiler V invokes to the specified compiler. Change the C compiler V invokes to the specified compiler.
The C compiler is required to support C99. The C compiler is required to support C99.
Officially supported/tested C compilers include: `clang`, `gcc`, `tcc`, `mingw-w64` and `msvc`. Officially supported/tested C compilers include: `clang`, `gcc`, `tcc`, `mingw-w64` and `msvc`.
-cf <flag>, -cflags <flag> -cflags <flag>
Pass the provided flag as is to the C compiler. Pass the provided flag as is to the C compiler.
Can be specified multiple times to provide multiple flags. Can be specified multiple times to provide multiple flags.
Use quotes to wrap the flag argument if it contains spaces. Use quotes to wrap the flag argument if it contains spaces.
-cg, -cdebug -printfn <fn_name>
Enable debug mode while preserving C line numbers in the compiled executable. Prints the content of the generated C function named fn_name. You can repeat that many times.
This allows issues regarding C compilation to be located more easily. This is useful when you just want to quickly tweak the generated C code,
without opening the generated .c file in an text editor.
-cg
Enable generating more debug information in the compiled executable.
This makes program backtraces more useful.
Using debuggers like gdb/lldb with such executables is easier too.
-compress -compress
Strip the compiled executable to compress it. Strip the compiled executable to compress it.
-csource <keep|drop> -keepc
Specify how V deals with the intermediate C source code. Specify that you want V to not delete the intermediate generated C source code.
* `keep` - The C source code will be kept as generated by V. Use with -cg for best debugging experience.
* `drop` (default) - The C source code will be deleted after compiling the executable.
-freestanding -freestanding
Build the executable without dependency on libc. Build the executable without dependency on libc.

View File

@ -41,11 +41,7 @@ The build flags are shared by the build and run commands:
Enable the specified experiment. Enable the specified experiment.
Currently, the only experiment available is: `prealloc` Currently, the only experiment available is: `prealloc`
-full-rebuild -cg
Force a full rebuild of all dependencies.
Enabled by default currently until caching works reliably.
-g
Compile the executable in debug mode, allowing code to be debugged more easily. Compile the executable in debug mode, allowing code to be debugged more easily.
-o <output>, -output <output> -o <output>, -output <output>

View File

@ -6,29 +6,34 @@ Usage:
Examples: Examples:
v hello.v Compile the file `hello.v` and output it as `hello` or `hello.exe`. v hello.v Compile the file `hello.v` and output it as `hello` or `hello.exe`.
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 -keepc -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.
The commands are: V supports the following commands:
build Build V code in the provided path (default). * New project scaffolding:
new Setup the file structure for a V project (in a sub folder). new Setup the file structure for a V project (in a sub folder).
init Setup the file structure for an already existing V project. init Setup the file structure for an already existing V project.
doc Generate the documentation for a V module. * Ordinary development:
fmt Format the V code provided.
repl Run the REPL.
run Compile and run a V program. run Compile and run a V program.
symlink Create a symbolic link for V.
test Run all test files in the provided directory. test Run all test files in the provided directory.
translate Translate C code to V (coming soon in 0.3). fmt Format the V code provided.
doc Generate the documentation for a V module.
repl Run the REPL.
* Installation/self updating:
symlink Create a symbolic link for V.
up Run the V self-updater. up Run the V self-updater.
self [-prod] Run the V self-compiler, use -prod to optimize compilation. self [-prod] Run the V self-compiler, use -prod to optimize compilation.
version Print the version text and exits. version Print the version text and exits.
* Module/package management:
install Install a module from VPM. install Install a module from VPM.
remove Remove a module that was installed from VPM. remove Remove a module that was installed from VPM.
search Search for a module from VPM. search Search for a module from VPM.
update Update an installed module from VPM. update Update an installed module from VPM.
* Others:
build Build a V code in the provided path (the default, so you can skip the word `build`).
translate Translate C code to V (coming soon in 0.3).
Use "v help <command>" for more information about a command, example: `v help build` Use "v help <command>" for more information about a command, example: `v help build`, `v help build-c`
Use "v help other" to see less frequently used commands. Use "v help other" to see less frequently used commands.
Note: Help is required to write more help topics. Note: Help is required to write more help topics.