Commit 59681d3
committed
Add
(This is only temporarily in `gix-testtools` and shall either be
moved to `internal-tools` or removed altogether.)
It is useful to be able to observe environment variables that are
set when running code with tools such as `cargo` or `cross`. This
is therefore not intended for general-purpose use. A system command
like `printenv` or `env` or a shell facility should be preferred
where applicable, since it is considered a feature rather than a
bug that commands like `cargo run -p gix-testtools env` include
changes to the environment from `cargo` itself.
Since one use for checking environment variables is to investigate
the effects of environments that contain variable names or values
that are not valid Unicode, this avoids requiring that environment
variables all be Unicode. Any name or value that is not Unicode is
shown in its Rust debug representation. This is always quoted, and
to decrease ambiguity any name or (more likely) value that contains
literal double quotes is likewise shown in its debug representation
so that it is always clear if a quotation mark is just for display.
Each name and value is otherwise shown literally. In either case
the name or its representation is separated by a `=` from the value
or its representation.env testtools subcommand to show the environment1 parent 2d634b2 commit 59681d3
1 file changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
12 | 25 | | |
13 | 26 | | |
14 | 27 | | |
| |||
27 | 40 | | |
28 | 41 | | |
29 | 42 | | |
| 43 | + | |
30 | 44 | | |
31 | 45 | | |
32 | 46 | | |
| |||
0 commit comments