Improve new CLI UX by supporting short -E flag for --expr
Change-Id: I55881c846da8416a92a14deedfa5bbbf09a122fb
This commit is contained in:
@@ -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
@@ -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}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user