Skip to content

Commit c6b5fa2

Browse files
laborgGerhard Aignervtjnash
authored
Indicate defaults in comandline help (#44223)
Co-authored-by: Gerhard Aigner <aigner@trium.de> Co-authored-by: Jameson Nash <vtjnash@gmail.com>
1 parent b6ffbeb commit c6b5fa2

File tree

4 files changed

+196
-146
lines changed

4 files changed

+196
-146
lines changed

doc/man/julia.1

Lines changed: 93 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,18 @@
2121
.\" - diagnostics
2222
.\" - notes
2323

24-
.TH JULIA 1 2013-12-10 Julia "Julia Programmers' Reference Guide"
24+
.TH JULIA 1 2022-02-17 JULIA
2525

2626
.\" from the front page of https://julialang.org/
2727
.SH NAME
2828
julia - a high-level, high-performance dynamic programming language for technical computing
2929

3030
.SH SYNOPSIS
31-
julia [option] [program] [args..]
31+
\fBjulia\fR [OPTIONS...] \fB--\fR [PROGRAMMFILE] [ARGS...]
32+
33+
If a Julia source file is given as a \fIPROGRAMFILE\fP (optionally followed by
34+
arguments in \fIARGS\fP) Julia will execute the program and exit.
3235

33-
.\" Taken almost verbatim from the front page of https://julialang.org/
3436
.SH DESCRIPTION
3537
Julia is a high-level, high-performance dynamic programming language
3638
for technical computing, with syntax that is familiar to users
@@ -49,10 +51,6 @@ For a more in-depth discussion of the rationale and advantages of Julia
4951
over other systems, please see the online manual:
5052
https://docs.julialang.org
5153

52-
If a Julia source file is given as a \fIprogram\fP (optionally followed by
53-
arguments in \fIargs\fP) Julia will execute the program and exit.
54-
55-
.\" This section was taken nearly verbatim from the output of `julia --help`
5654
.SH "COMMAND-LINE OPTIONS"
5755

5856
.TP
@@ -63,6 +61,10 @@ Display version information
6361
-h, --help
6462
Print help message
6563

64+
.TP
65+
--help-hidden
66+
Print uncommon options not shown by `-h`
67+
6668
.TP
6769
--project[=<dir>/@.]
6870
Set <dir> as the home project/environment. The default @. option will search
@@ -73,22 +75,27 @@ found.
7375
-J, --sysimage <file>
7476
Start up with the given system image file
7577

76-
.TP
77-
--sysimage-native-code={yes|no}
78-
Use precompiled code from system image if available
79-
8078
.TP
8179
-H, --home <dir>
8280
Set location of julia executable
8381

8482
.TP
85-
--startup-file={yes|no}
86-
Load ~/.julia/config/startup.jl
83+
--startup-file={yes*|no}
84+
Load `JULIA_DEPOT_PATH/config/startup.jl`; if `JULIA_DEPOT_PATH`
85+
environment variable is unset, load `~/.julia/config/startup.jl`
8786

8887
.TP
89-
--handle-signals={yes|no}
88+
--handle-signals={yes*|no}
9089
Enable or disable Julia's default signal handlers
9190

91+
.TP
92+
--sysimage-native-code={yes*|no}
93+
Use native code from system image if available
94+
95+
.TP
96+
--compiled-modules={yes*|no}
97+
Enable or disable incremental precompilation of modules
98+
9299
.TP
93100
-e, --eval <expr>
94101
Evaluate <expr>
@@ -112,77 +119,96 @@ process affinity is not configured, it uses the number of CPU
112119
threads.
113120

114121
.TP
115-
-p, --procs <n>
116-
Run n local processes
122+
-p, --procs {N|auto}
123+
Integer value N launches N additional local worker processes `auto` launches as many workers
124+
as the number of local CPU threads (logical cores)
117125

118126
.TP
119127
--machine-file <file>
120128
Run processes on hosts listed in <file>
121129

122130
.TP
123131
-i
124-
Interactive mode; REPL runs and isinteractive() is true
132+
Interactive mode; REPL runs and `isinteractive()` is true
133+
134+
.TP
135+
-q, --quiet
136+
Quiet startup: no banner, suppress REPL warnings
125137

126138
.TP
127-
--banner={yes|no|auto}
139+
--banner={yes|no|auto*}
128140
Enable or disable startup banner
129141

130142
.TP
131-
--color={yes|no|auto}
143+
--color={yes|no|auto*}
132144
Enable or disable color text
133145

134146
.TP
135-
--history-file={yes|no}
147+
--history-file={yes*|no}
136148
Load or save history
137149

138150
.TP
139-
--compile={yes|no|all|min}
140-
Enable or disable compiler, or request exhaustive or minimal compilation
151+
--depwarn={yes|no*|error}
152+
Enable or disable syntax and method deprecation warnings (`error` turns warnings into errors)
141153

142154
.TP
143-
-C, --cpu-target=<target>
144-
Limit usage of cpu features up to <target>
155+
--warn-overwrite={yes|no*}
156+
Enable or disable method overwrite warnings
145157

146158
.TP
147-
-O, --optimize
148-
Run time-intensive code optimizations
159+
--warn-scope={yes*|no}
160+
Enable or disable warning for ambiguous top-level scope
149161

150162
.TP
151-
-O <n>, --optimize=<n>
152-
Set the optimization level to <n>
163+
-C, --cpu-target=<target>
164+
Limit usage of CPU features up to <target>; set to `help` to see the available options
153165

154166
.TP
155-
--min-optlevel=<n>
156-
Set the minimum optimization level to <n>, overriding per-module settings
167+
-O, --optimize={0,1,2*,3}
168+
Set the optimization level (level 3 if `-O` is used without a level)
157169

158170
.TP
159-
-g
160-
Enable generation of full debug info
171+
--min-optlevel={0*,1,2,3}
172+
Set a lower bound on the optimization level
161173

162174
.TP
163-
-g <n>
164-
Set the level of debug info generation to <n>
175+
-g {0,1*,2}
176+
Set the level of debug info generation (level 2 if `-g` is used without a level)
165177

166178
.TP
167-
--inline={yes|no}
168-
Control whether inlining is permitted (overrides functions declared as @inline)
179+
--inline={yes*|no}
180+
Control whether inlining is permitted, including overriding @inline declarations
169181

170182
.TP
171-
--check-bounds={yes|no|auto}
183+
--check-bounds={yes|no|auto*}
172184
Emit bounds checks always, never, or respect @inbounds declarations
173185

174186
.TP
175187
--math-mode={ieee|user}
176-
Always use IEEE semantics for math (ignoring declarations),
177-
or adhere to declarations in source code
188+
Disallow or enable unsafe floating point optimizations (overrides @fastmath declaration)
178189

179190
.TP
180-
--depwarn={yes|no|error}
181-
Enable or disable syntax and method deprecation warnings ('error' turns warnings into errors)
191+
--code-coverage[={none*|user|all}]
192+
Count executions of source lines (omitting setting is equivalent to `user`)
182193

183194
.TP
184-
--warn-overwrite={yes|no}
185-
Enable or disable method overwrite warnings
195+
--code-coverage=tracefile.info
196+
Append coverage information to the LCOV tracefile (filename supports format tokens)
197+
198+
.TP
199+
--track-allocation[={none*|user|all}]
200+
Count bytes allocated by each source line (omitting setting is equivalent to `user`)
201+
202+
.TP
203+
--bug-report=KIND
204+
Launch a bug report session. It can be used to start a REPL, run a script, or evaluate
205+
expressions. It first tries to use BugReporting.jl installed in current environment and
206+
fallbacks to the latest compatible BugReporting.jl if not. For more information, see
207+
--bug-report=help.
208+
209+
.TP
210+
--compile={yes*|no|all|min}
211+
Enable or disable JIT compiler, or request exhaustive or minimal compilation
186212

187213
.TP
188214
--output-o <name>
@@ -192,36 +218,45 @@ Generate an object file (including system image data)
192218
--output-ji <name>
193219
Generate a system image data file (.ji)
194220

221+
.TP
222+
--strip-metadata
223+
Remove docstrings and source location info from system image
224+
225+
.TP
226+
--strip-ir
227+
Remove IR (intermediate representation) of compiled functions
228+
229+
.TP
230+
--output-unopt-bc <name>
231+
Generate unoptimized LLVM bitcode (.bc)
232+
195233
.TP
196234
--output-bc <name>
197235
Generate LLVM bitcode (.bc)
198236

199237
.TP
200-
--output-incremental={yes|no}
201-
Generate an incremental output file (rather than complete)
238+
--output-asm <name>
239+
Generate an assembly file (.s)
202240

203241
.TP
204-
--code-coverage={none|user|all}, --code-coverage
205-
Count executions of source lines (omitting setting is equivalent to 'user')
242+
--output-incremental={yes|no*}
243+
Generate an incremental output file (rather than complete)
206244

207245
.TP
208-
--track-allocation={none|user|all}, --track-allocation
209-
Count bytes allocated by each source line
246+
--trace-compile={stderr,name}
247+
Print precompile statements for methods compiled during execution or save to a path
210248

211-
.SH FILES
212-
.I ~/.julia/config/startup.jl
213-
.RS
214-
Per user startup file.
215-
.RE
249+
.TP
250+
-image-codegen
251+
Force generate code in imaging mode
216252

217-
.I /etc/julia/startup.jl
218-
.RS
219-
System-wide startup file.
220-
.RE
253+
.SH FILES AND ENVIRONMENT
254+
See https://docs.julialang.org/en/v1/manual/environment-variables/
221255

222256
.SH BUGS
223257
Please report any bugs using the GitHub issue tracker:
224258
https://github.com/julialang/julia/issues?state=open
225259

260+
226261
.SH AUTHORS
227262
Contributors: https://github.com/JuliaLang/julia/graphs/contributors

doc/src/manual/command-line-options.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,20 @@ There are various ways to run Julia code and provide options, similar to those a
7272
julia [switches] -- [programfile] [args...]
7373
```
7474

75-
The following is a complete list of command-line switches available when launching julia, e.g.
76-
75+
The following is a complete list of command-line switches available when launching julia (a '*' marks the default value, if applicable):
7776

7877
|Switch |Description|
7978
|:--- |:---|
8079
|`-v`, `--version` |Display version information|
8180
|`-h`, `--help` |Print command-line options (this message).|
81+
|`--help-hidden` |Uncommon options not shown by `-h`|
8282
|`--project[={<dir>\|@.}]` |Set `<dir>` as the home project/environment. The default `@.` option will search through parent directories until a `Project.toml` or `JuliaProject.toml` file is found.|
8383
|`-J`, `--sysimage <file>` |Start up with the given system image file|
8484
|`-H`, `--home <dir>` |Set location of `julia` executable|
85-
|`--startup-file={yes\|no}` |Load `~/.julia/config/startup.jl`|
86-
|`--handle-signals={yes\|no}` |Enable or disable Julia's default signal handlers|
87-
|`--sysimage-native-code={yes\|no}` |Use native code from system image if available|
88-
|`--compiled-modules={yes\|no}` |Enable or disable incremental precompilation of modules|
85+
|`--startup-file={yes*\|no}` |Load `JULIA_DEPOT_PATH/config/startup.jl`; if `JULIA_DEPOT_PATH` environment variable is unset, load `~/.julia/config/startup.jl`|
86+
|`--handle-signals={yes*\|no}` |Enable or disable Julia's default signal handlers|
87+
|`--sysimage-native-code={yes*\|no}` |Use native code from system image if available|
88+
|`--compiled-modules={yes*\|no}` |Enable or disable incremental precompilation of modules|
8989
|`-e`, `--eval <expr>` |Evaluate `<expr>`|
9090
|`-E`, `--print <expr>` |Evaluate `<expr>` and display the result|
9191
|`-L`, `--load <file>` |Load `<file>` immediately on all processors|
@@ -94,23 +94,34 @@ The following is a complete list of command-line switches available when launchi
9494
|`--machine-file <file>` |Run processes on hosts listed in `<file>`|
9595
|`-i` |Interactive mode; REPL runs and `isinteractive()` is true|
9696
|`-q`, `--quiet` |Quiet startup: no banner, suppress REPL warnings|
97-
|`--banner={yes\|no\|auto}` |Enable or disable startup banner|
98-
|`--color={yes\|no\|auto}` |Enable or disable color text|
99-
|`--history-file={yes\|no}` |Load or save history|
100-
|`--depwarn={yes\|no\|error}` |Enable or disable syntax and method deprecation warnings (`error` turns warnings into errors)|
101-
|`--warn-overwrite={yes\|no}` |Enable or disable method overwrite warnings|
97+
|`--banner={yes\|no\|auto*}` |Enable or disable startup banner|
98+
|`--color={yes\|no\|auto*}` |Enable or disable color text|
99+
|`--history-file={yes*\|no}` |Load or save history|
100+
|`--depwarn={yes\|no*\|error}` |Enable or disable syntax and method deprecation warnings (`error` turns warnings into errors)|
101+
|`--warn-overwrite={yes\|no*}` |Enable or disable method overwrite warnings|
102+
|`--warn-scope={yes*\|no}` |Enable or disable warning for ambiguous top-level scope|
102103
|`-C`, `--cpu-target <target>` |Limit usage of CPU features up to `<target>`; set to `help` to see the available options|
103-
|`-O`, `--optimize={0,1,2,3}` |Set the optimization level (default level is 2 if unspecified or 3 if used without a level)|
104-
|`--min-optlevel={0,1,2,3}` |Set the lower bound on per-module optimization (default is 0)|
105-
|`-g`, `-g <level>` |Enable or set the level of debug info generation (default level is 1 if unspecified or 2 if used without a level)|
104+
|`-O`, `--optimize={0,1,2*,3}` |Set the optimization level (level is 3 if `-O` is used without a level)|
105+
|`--min-optlevel={0*,1,2,3}` |Set the lower bound on per-module optimization|
106+
|`-g {0,1*,2}` |Set the level of debug info generation (level is 2 if `-g` is used without a level)|
106107
|`--inline={yes\|no}` |Control whether inlining is permitted, including overriding `@inline` declarations|
107-
|`--check-bounds={yes\|no\|auto}` |Emit bounds checks always, never, or respect `@inbounds` declarations|
108+
|`--check-bounds={yes\|no\|auto*}` |Emit bounds checks always, never, or respect `@inbounds` declarations|
108109
|`--math-mode={ieee,fast}` |Disallow or enable unsafe floating point optimizations (overrides `@fastmath` declaration)|
109-
|`--code-coverage={none\|user\|all}` |Count executions of source lines|
110-
|`--code-coverage` |equivalent to `--code-coverage=user`|
111-
|`--track-allocation={none\|user\|all}` |Count bytes allocated by each source line|
112-
|`--track-allocation` |equivalent to `--track-allocation=user`|
113-
110+
|`--code-coverage[={none*\|user\|all}]` |Count executions of source lines (omitting setting is equivalent to `user`)|
111+
|`--code-coverage=tracefile.info` |Append coverage information to the LCOV tracefile (filename supports format tokens).|
112+
|`--track-allocation[={none*\|user\|all}]` |Count bytes allocated by each source line (omitting setting is equivalent to "user")|
113+
|`--bug-report=KIND` |Launch a bug report session. It can be used to start a REPL, run a script, or evaluate expressions. It first tries to use BugReporting.jl installed in current environment and fallbacks to the latest compatible BugReporting.jl if not. For more nformation, see `--bug-report=help`.|
114+
|`--compile={yes*\|no\|all\|min}` |Enable or disable JIT compiler, or request exhaustive or minimal compilation|
115+
|`--output-o <name>` |Generate an object file (including system image data)|
116+
|`--output-ji <name>` |Generate a system image data file (.ji)|
117+
|`--strip-metadata` |Remove docstrings and source location info from system image|
118+
|`--strip-ir` |Remove IR (intermediate representation) of compiled functions|
119+
|`--output-unopt-bc <name>` |Generate unoptimized LLVM bitcode (.bc)|
120+
|`--output-bc <name>` |Generate LLVM bitcode (.bc)|
121+
|`--output-asm <name>` |Generate an assembly file (.s)|
122+
|`--output-incremental={yes\|no*}` |Generate an incremental output file (rather than complete)|
123+
|`--trace-compile={stderr,name}` |Print precompile statements for methods compiled during execution or save to a path|
124+
|`--image-codegen` |Force generate code in imaging mode|
114125

115126

116127
!!! compat "Julia 1.1"

0 commit comments

Comments
 (0)