Improve new CLI UX by supporting short -E flag for --expr

Change-Id: I55881c846da8416a92a14deedfa5bbbf09a122fb
This commit is contained in:
Lunaphied
2024-03-24 21:17:51 -06:00
parent a7161b6c0f
commit 185ecf1f45
4 changed files with 18 additions and 2 deletions
+1
View File
@@ -187,6 +187,7 @@ SourceExprCommand::SourceExprCommand()
addFlag({
.longName = "expr",
.shortName = 'E',
.description = "Interpret [*installables*](@docroot@/command-ref/new-cli/nix.md#installables) as attribute paths relative to the Nix expression *expr*.",
.category = installablesCategory,
.labels = {"expr"},
+2 -2
View File
@@ -8,10 +8,10 @@ R""(
# nix eval --expr '1 + 2'
```
* Evaluate a Nix expression to JSON:
* Evaluate a Nix expression to JSON using the short-form expression flag:
```console
# nix eval --json --expr '{ x = 1; }'
# nix eval --json -E '{ x = 1; }'
{"x":1}
```