Skip to content

Commit ac71f9e

Browse files
authored
v.help: improve message formatting (#23363)
1 parent e5ad9a6 commit ac71f9e

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

vlib/v/help/build/build.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ to be a .v source file or folder containing .v source files.
99
Everything after that, is assumed to be flags, that V will ignore itself,
1010
but will pass to the executable after it is compiled.
1111

12-
This enables you to do for example: `v -cc gcc -g myfile.v run -param1 abcde`
12+
This enables you to do for example: `v -cc gcc -g run myfile.v -param1 abcde`
1313
... which means for V: "compile using gcc, produce debugging information,
1414
then run `./myfile -param1 abcde` and exit with its exit code".
1515

@@ -59,7 +59,7 @@ NB: the build flags are shared with the run command too:
5959
value assigned to `<flag>`.
6060
If no flag identifier (or value) is assigned, `$d()` will return the passed `<default value>`.
6161

62-
-g
62+
-g, -debug
6363
Compile the executable in debug mode, allowing code to be debugged more easily.
6464

6565
-o <output>, -output <output>

vlib/v/help/default.txt

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@ Examples:
88
`hello` or `hello.exe`.
99
v run hello.v Same as above but also run the produced
1010
executable immediately after compilation.
11-
v -g run hello.v Same as above, but make debugging easier
12-
(in case your program crashes).
13-
v crun hello.v Same as above, but do not recompile, if the
14-
executable already exists, and is newer than the
11+
v -g run hello.v Same as above but makes debugging easier
12+
(Useful in case your program crashes).
13+
(see `v help build` and `v help build-c`
14+
for more information)
15+
v crun hello.v Same as above but do not recompile if the
16+
executable already exists and is newer than the
1517
sources.
16-
v -o h.c hello.v Translate `hello.v` to `h.c`. Do not compile
18+
v -o h.c hello.v Translate `hello.v` to `h.c` only. Do not compile
1719
further.
18-
v -o - hello.v Translate `hello.v` and output the C source code
19-
to stdout. Do not compile further.
20-
v watch hello.v Re-does the same compilation, when a source code
21-
change is detected.
22-
The program is only compiled, not run.
23-
v watch run hello.v Re-runs the same `hello.v` file, when a source
20+
v -o - hello.v Translates `hello.v` and outputs the C source
21+
code to stdout. Does not compile further.
22+
v watch hello.v Re-do the same compilation when a source code
23+
change is detected. The compiled result does not
24+
get executed, only compiled.
25+
v watch run hello.v Re-run the same `hello.v` file when a source
2426
code change is detected.
2527

2628
V supports the following commands:
@@ -44,11 +46,13 @@ V supports the following commands:
4446
fmt Format the V code provided.
4547
vet Report suspicious code constructs.
4648
doc Generate the documentation for a V module.
49+
example: `v doc strings`
4750
vlib-docs Generate and open the documentation of all the
4851
vlib modules.
49-
repl Run the REPL.
52+
repl Run the REPL (Read-eval-print loop).
5053
watch Re-compile/re-run a source file, each time it is
5154
changed.
55+
example: `v watch run hello.v`
5256
where Find and print the location of current project
5357
declarations.
5458

@@ -76,5 +80,5 @@ Use "v help other" to see less frequently used commands.
7680
Use "v help topics" to see a list of all known help topics.
7781

7882
Note: Help is required to write more help topics.
79-
Only build, new, init, doc, fmt, vet, run, test, watch, search, install, remove,
80-
update, bin2v, check-md are properly documented currently.
83+
Only build, new, init, doc, fmt, vet, run, test, watch, search, install,
84+
remove, update, bin2v, check-md are properly documented currently.

0 commit comments

Comments
 (0)