2020-03-13 22:52:49 +03:00
|
|
|
V is a tool for managing V source code.
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
v [options] [command] [arguments]
|
|
|
|
|
|
|
|
Examples:
|
2020-04-25 11:15:51 +03:00
|
|
|
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.
|
2020-10-26 12:24:25 +03:00
|
|
|
v -cg run hello.v Same as above, but make debugging easier (in case your program crashes).
|
2020-04-25 11:15:51 +03:00
|
|
|
v -o h.c hello.v Translate `hello.v` to `h.c`. Do not compile further.
|
2021-07-18 16:34:47 +03:00
|
|
|
v -o - hello.v Translate `hello.v` and output the C source code to stdout. Do not compile further.
|
2021-05-25 14:30:48 +03:00
|
|
|
|
|
|
|
v watch hello.v Re-does the same compilation, when a source code change is detected.
|
2021-05-05 21:31:45 +03:00
|
|
|
The program is only compiled, not run.
|
|
|
|
v watch run hello.v Re-runs the same `hello.v` file, when a source code change is detected.
|
2020-03-13 22:52:49 +03:00
|
|
|
|
2020-04-25 11:15:51 +03:00
|
|
|
V supports the following commands:
|
|
|
|
* New project scaffolding:
|
2020-04-07 20:37:15 +03:00
|
|
|
new Setup the file structure for a V project (in a sub folder).
|
|
|
|
init Setup the file structure for an already existing V project.
|
2021-03-13 09:37:12 +03:00
|
|
|
|
2020-04-25 11:15:51 +03:00
|
|
|
* Ordinary development:
|
|
|
|
run Compile and run a V program.
|
|
|
|
test Run all test files in the provided directory.
|
2020-03-14 16:20:44 +03:00
|
|
|
fmt Format the V code provided.
|
2020-07-13 17:41:47 +03:00
|
|
|
vet Report suspicious code constructs.
|
2020-04-25 11:15:51 +03:00
|
|
|
doc Generate the documentation for a V module.
|
2020-06-02 13:10:01 +03:00
|
|
|
vlib-docs Generate and open the documentation of all the vlib modules.
|
2020-03-14 16:20:44 +03:00
|
|
|
repl Run the REPL.
|
2021-05-05 21:31:45 +03:00
|
|
|
watch Re-compile/re-run a source file, each time it is changed.
|
2021-03-13 09:37:12 +03:00
|
|
|
|
2020-04-25 11:15:51 +03:00
|
|
|
* Installation/self updating:
|
2020-03-14 16:20:44 +03:00
|
|
|
symlink Create a symbolic link for V.
|
|
|
|
up Run the V self-updater.
|
2020-03-16 17:46:38 +03:00
|
|
|
self [-prod] Run the V self-compiler, use -prod to optimize compilation.
|
2020-03-14 16:20:44 +03:00
|
|
|
version Print the version text and exits.
|
2021-03-13 09:37:12 +03:00
|
|
|
|
2020-07-13 17:41:47 +03:00
|
|
|
* Module/package management:
|
2020-03-14 16:20:44 +03:00
|
|
|
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.
|
2020-08-18 03:44:18 +03:00
|
|
|
upgrade Upgrade all the outdated modules.
|
2020-07-20 17:39:37 +03:00
|
|
|
list List all installed modules.
|
2021-05-25 14:30:48 +03:00
|
|
|
outdated List installed modules that need updates.
|
|
|
|
show Display information about a module on vpm
|
2021-03-13 09:37:12 +03:00
|
|
|
|
2020-04-25 11:15:51 +03:00
|
|
|
* Others:
|
2021-03-13 09:37:12 +03:00
|
|
|
doctor Display some useful info about your system to help reporting bugs.
|
2020-04-25 11:15:51 +03:00
|
|
|
translate Translate C code to V (coming soon in 0.3).
|
2020-07-20 12:36:27 +03:00
|
|
|
tracev Produce a tracing version of the v compiler.
|
|
|
|
Use `tracev yourfile.v` when the compiler panics.
|
|
|
|
NB: `tracev` is much slower and more verbose than ordinary `v`
|
2020-03-13 22:52:49 +03:00
|
|
|
|
2021-05-23 05:54:28 +03:00
|
|
|
Use "v help <command>" for more information about a command, example: `v help build`, `v help build-c`, `v help build-native`
|
2020-03-13 22:52:49 +03:00
|
|
|
Use "v help other" to see less frequently used commands.
|
2021-07-26 09:41:04 +03:00
|
|
|
Use "v help topics" to see a list of all known help topics.
|
2020-03-13 22:52:49 +03:00
|
|
|
|
2020-03-14 16:20:44 +03:00
|
|
|
Note: Help is required to write more help topics.
|
2021-05-05 21:31:45 +03:00
|
|
|
Only build, new, init, doc, fmt, vet, run, test, watch, search, install, remove, update, bin2v, check-md are properly documented currently.
|