# zig env: remove the json output · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/053119083c2c93cb1fc4129bc647c03301f4010d)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 053119083c2c93cb1fc4129bc647c03301f4010d

Requested commit: 053119083c2c93cb1fc4129bc647c03301f4010d

Commit: 053119083c2c93cb1fc4129bc647c03301f4010d

Tree: 242484e01291155621e8655635fa9e4276eb03b1

Author: Manlio Perillo

Committer: Andrew Kelley

## Message

```
zig env: remove the json output

The current json output is not very convenient to use from the shell or
a Zig program.
An example using the shell: `zig env | jq -r .lib_dir`.

Remove the json output, and instead use the POSIX shell syntax:
  name="value"

Additionally, when args is not empty, assume each argument is the
environment variable name and print the associated value.
Unrecognized environment variables are ignored.

The new output format has been copied from `go env`, with the difference
that `go env` uses OS specific syntax for windows and plan9.

Define the environment variables in a single place, in order to avoid
possible bugs.

```

## Parents

- [7a9500fd80990a3dc47821e627162bf769eecbba](https://git.cafe/gitcafe/zig/commit/7a9500fd80990a3dc47821e627162bf769eecbba?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/053119083c2c93cb1fc4129bc647c03301f4010d?format=markdown)
