Skip to content

Commit 8b3aedc

Browse files
committed
docs(dev-guide): improve suggestion for overriding arg0
1 parent e2cfa45 commit 8b3aedc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

doc/dev-guide/src/tips-and-tricks.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ it's a particular binary, rather than e.g. copying it, symlinking it or other
77
tricks with exec. This is handy when testing particular code paths from cargo
88
run.
99

10-
```shell
11-
RUSTUP_FORCE_ARG0=rustup cargo run -- uninstall nightly
10+
For example, if you want to run `rustup show` with `cargo run`, you may execute:
11+
12+
```console
13+
> cargo run --config env.RUSTUP_FORCE_ARG0=\'rustup\' -- show
1214
```
1315

16+
This command passes the `RUSTUP_FORCE_ARG0` environment variable to the
17+
`rustup-init` binary without influencing the `cargo run` command itself,
18+
which is very important since `cargo` could also be a rustup proxy.
19+
1420
## `RUSTUP_BACKTRACK_LIMIT`
1521

1622
If it's necessary to alter the backtracking limit from the default of half

0 commit comments

Comments
 (0)