mirror of
https://github.com/NixOS/nix
synced 2025-07-08 06:53:54 +02:00
New CLI flag --replace-eval-errors
Co-authored-by: Farid Zakaria <farid.m.zakaria@gmail.com>
This commit is contained in:
parent
cdbe788c1f
commit
88705f848b
14 changed files with 93 additions and 20 deletions
|
@ -112,6 +112,11 @@ standard input.
|
|||
When used with `--eval`, print the resulting value as an JSON
|
||||
representation of the abstract syntax tree rather than as a Nix expression.
|
||||
|
||||
- `--replace-eval-errors`
|
||||
|
||||
When used with `--eval` and `--json`, replace any evaluation errors with the string
|
||||
`"«evaluation error»"`.
|
||||
|
||||
- `--xml`
|
||||
|
||||
When used with `--eval`, print the resulting value as an XML
|
||||
|
@ -205,3 +210,10 @@ $ nix-instantiate --eval --xml --strict --expr '{ x = {}; }'
|
|||
</attrs>
|
||||
</expr>
|
||||
```
|
||||
|
||||
Replacing evaluation errors:
|
||||
|
||||
```console
|
||||
$ nix-instantiate --eval --json --replace-eval-errors --expr '{ a = throw "fail"; }'
|
||||
{"a":"«evaluation error»"}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue