Skip to content

Commit 6269ab4

Browse files
committed
docs(config): make --config <PATH> more prominent
1 parent bd31b4a commit 6269ab4

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/doc/src/reference/config.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,14 @@ In addition to the system above, Cargo recognizes a few other specific
220220

221221
Cargo also accepts arbitrary configuration overrides through the
222222
`--config` command-line option. The argument should be in TOML syntax of
223-
`KEY=VALUE`:
223+
`KEY=VALUE` or provided as a path to an extra configuration file:
224224

225225
```console
226+
# With `KEY=VALUE` in TOML syntax
226227
cargo --config net.git-fetch-with-cli=true fetch
228+
229+
# With a path to a configuration file
230+
cargo --config ./path/to/my/extra-config.toml fetch
227231
```
228232

229233
The `--config` option may be specified multiple times, in which case the
@@ -232,6 +236,10 @@ that is used when multiple configuration files apply. Configuration
232236
values specified this way take precedence over environment variables,
233237
which take precedence over configuration files.
234238

239+
When the `--config` option is provided as an extra configuration file,
240+
The configuration file loaded this way follow the same precedence rules
241+
as other options specified directly with `--config`.
242+
235243
Some examples of what it looks like using Bourne shell syntax:
236244

237245
```console
@@ -251,11 +259,6 @@ cargo --config "target.'cfg(all(target_arch = \"arm\", target_os = \"none\"))'.r
251259
cargo --config profile.dev.package.image.opt-level=3 …
252260
```
253261

254-
The `--config` option can also be used to pass paths to extra
255-
configuration files that Cargo should use for a specific invocation.
256-
Options from configuration files loaded this way follow the same
257-
precedence rules as other options specified directly with `--config`.
258-
259262
## Config-relative paths
260263

261264
Paths in config files may be absolute, relative, or a bare name without any path separators.

0 commit comments

Comments
 (0)