From 1863dda8e504956e8f5fd9f6f611be5d207da69f Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 25 Apr 2020 11:15:51 +0300 Subject: [PATCH] help: update help .txt files --- cmd/v/internal/help/build-c.txt | 23 ++++++++++++++--------- cmd/v/internal/help/build.txt | 6 +----- cmd/v/internal/help/default.txt | 29 +++++++++++++++++------------ 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/cmd/v/internal/help/build-c.txt b/cmd/v/internal/help/build-c.txt index de43ade784..2a87203ab3 100644 --- a/cmd/v/internal/help/build-c.txt +++ b/cmd/v/internal/help/build-c.txt @@ -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. List of supported architectures: `x86` and `x64` (default). - -cc , -compiler + -cc Change the C compiler V invokes to the specified compiler. The C compiler is required to support C99. Officially supported/tested C compilers include: `clang`, `gcc`, `tcc`, `mingw-w64` and `msvc`. - -cf , -cflags + -cflags Pass the provided flag as is to the C compiler. Can be specified multiple times to provide multiple flags. Use quotes to wrap the flag argument if it contains spaces. - -cg, -cdebug - Enable debug mode while preserving C line numbers in the compiled executable. - This allows issues regarding C compilation to be located more easily. + -printfn + Prints the content of the generated C function named fn_name. You can repeat that many times. + 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 Strip the compiled executable to compress it. - -csource - Specify how V deals with the intermediate C source code. - * `keep` - The C source code will be kept as generated by V. - * `drop` (default) - The C source code will be deleted after compiling the executable. + -keepc + Specify that you want V to not delete the intermediate generated C source code. + Use with -cg for best debugging experience. -freestanding Build the executable without dependency on libc. diff --git a/cmd/v/internal/help/build.txt b/cmd/v/internal/help/build.txt index 541519d479..94cec5896f 100644 --- a/cmd/v/internal/help/build.txt +++ b/cmd/v/internal/help/build.txt @@ -41,11 +41,7 @@ The build flags are shared by the build and run commands: Enable the specified experiment. Currently, the only experiment available is: `prealloc` - -full-rebuild - Force a full rebuild of all dependencies. - Enabled by default currently until caching works reliably. - - -g + -cg Compile the executable in debug mode, allowing code to be debugged more easily. -o , -output diff --git a/cmd/v/internal/help/default.txt b/cmd/v/internal/help/default.txt index 457d6bf40e..fee9de4fc9 100644 --- a/cmd/v/internal/help/default.txt +++ b/cmd/v/internal/help/default.txt @@ -4,31 +4,36 @@ Usage: v [options] [command] [arguments] Examples: - 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 -o h.c hello.v Translate `hello.v` to `h.c`. Do not compile further. + 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 -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. -The commands are: - build Build V code in the provided path (default). +V supports the following commands: +* New project scaffolding: new Setup the file structure for a V project (in a sub folder). init Setup the file structure for an already existing V project. - doc Generate the documentation for a V module. - fmt Format the V code provided. - repl Run the REPL. +* Ordinary development: run Compile and run a V program. - symlink Create a symbolic link for V. 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. self [-prod] Run the V self-compiler, use -prod to optimize compilation. version Print the version text and exits. - +* Module/package management: install Install a module from VPM. remove Remove a module that was installed from VPM. search Search for a 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 " for more information about a command, example: `v help build` +Use "v help " for more information about a command, example: `v help build`, `v help build-c` Use "v help other" to see less frequently used commands. Note: Help is required to write more help topics.