@@ -220,10 +220,14 @@ In addition to the system above, Cargo recognizes a few other specific
220
220
221
221
Cargo also accepts arbitrary configuration overrides through the
222
222
` --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 :
224
224
225
225
``` console
226
+ # With ` KEY=VALUE` in TOML syntax
226
227
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
227
231
```
228
232
229
233
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
232
236
values specified this way take precedence over environment variables,
233
237
which take precedence over configuration files.
234
238
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
+
235
243
Some examples of what it looks like using Bourne shell syntax:
236
244
237
245
``` console
@@ -251,11 +259,6 @@ cargo --config "target.'cfg(all(target_arch = \"arm\", target_os = \"none\"))'.r
251
259
cargo --config profile.dev.package.image.opt-level=3 …
252
260
```
253
261
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
-
259
262
## Config-relative paths
260
263
261
264
Paths in config files may be absolute, relative, or a bare name without any path separators.
0 commit comments