Skip to content

Commit 1c44404

Browse files
committed
Clarify [doc].browser docs, document PathAndArgs better
1 parent 6128b54 commit 1c44404

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

src/doc/src/reference/config.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,20 @@ runner = "foo" # Searches `PATH` for `foo`.
195195
directory = "vendor"
196196
```
197197

198+
### Executable paths with arguments
199+
200+
Some Cargo commands invoke external programs, which can be configured as a path
201+
and some number of arguments.
202+
203+
The value may be an array of strings like `['/path/to/program', 'somearg']` or
204+
a space-separated string like `'/path/to/program somearg'`. If the path to the
205+
executable contains a space, the list form must be used.
206+
207+
If Cargo is passing other arguments to the program such as a path to open or
208+
run, they will be passed after the last specified argument in the value of an
209+
option of this format. If the specified program does not have path separators,
210+
Cargo will search `PATH` for its executable.
211+
198212
### Credentials
199213

200214
Configuration values with sensitive information are stored in the
@@ -406,6 +420,10 @@ The `[doc]` table defines options for the [`cargo doc`] command.
406420

407421
##### `doc.browser`
408422

423+
* Type: string or array of strings ([program path and args])
424+
* Default: `BROWSER` environment variable, or, if that is missing,
425+
opening the link in a system specific way
426+
409427
This option sets the browser to be used by [`cargo doc`], overriding the
410428
`BROWSER` environment variable when opening documentation with the `--open`
411429
option.
@@ -837,7 +855,7 @@ Specifies the linker which is passed to `rustc` (via [`-C linker`]) when the
837855
`<triple>` is being compiled for. By default, the linker is not overridden.
838856

839857
##### `target.<triple>.runner`
840-
* Type: string or array of strings (program path and args)
858+
* Type: string or array of strings ([program path and args])
841859
* Default: none
842860
* Environment: `CARGO_TARGET_<triple>_RUNNER`
843861

@@ -846,12 +864,6 @@ executed by invoking the specified runner with the actual executable passed as
846864
an argument. This applies to [`cargo run`], [`cargo test`] and [`cargo bench`]
847865
commands. By default, compiled executables are executed directly.
848866

849-
The value may be an array of strings like `['/path/to/program', 'somearg']` or
850-
a space-separated string like `'/path/to/program somearg'`. The arguments will
851-
be passed to the runner with the executable to run as the last argument. If
852-
the runner program does not have path separators, it will search `PATH` for
853-
the runner executable.
854-
855867
##### `target.<cfg>.runner`
856868

857869
This is similar to the [target runner](#targettriplerunner), but using
@@ -958,6 +970,7 @@ Sets the width for progress bar.
958970
[toml]: https://toml.io/
959971
[incremental compilation]: profiles.md#incremental
960972
[profile]: profiles.md
973+
[program path with args]: #executable-paths-with-arguments
961974
[libcurl format]: https://ec.haxx.se/usingcurl-proxies.html
962975
[source replacement]: source-replacement.md
963976
[revision]: https://git-scm.com/docs/gitrevisions

0 commit comments

Comments
 (0)