2
0
Fork 0
mirror of https://github.com/nushell/nushell synced 2025-02-15 21:48:29 +00:00
nushell/tests
Stefan Holderbach c9e9b138eb
Improve with-env robustness ()
# Description
Work for 

- **Error `with-env` given uneven count in list form**
- **Fix `with-env` `CantConvert` to record**
- **Error `with-env` when given protected env vars**
- **Deprecate list/table input of vars to `with-env`**
- **Remove examples for deprecated input**

# User-Facing Changes

## Deprecation of the following forms

```
> with-env [MYENV "my env value"] { $env.MYENV }
my env value

> with-env [X Y W Z] { $env.X }
Y

> with-env [[X W]; [Y Z]] { $env.W }
Z
```

## recommended standardized form

```
# Set by key-value record
> with-env {X: "Y", W: "Z"} { [$env.X $env.W] }
╭───┬───╮
│ 0 │ Y │
│ 1 │ Z │
╰───┴───╯
```

## (Side effect) Repeated definitions in an env shorthand are now
disallowed

```
> FOO=bar FOO=baz $env
Error: nu:🐚:column_defined_twice

  × Record field or table column used twice: FOO
   ╭─[entry #1:1:1]
 1 │ FOO=bar FOO=baz $env
   · ─┬─     ─┬─
   ·  │       ╰── field redefined here
   ·  ╰── field first defined here
   ╰────
```
2024-04-16 19:08:58 +08:00
..
assets/nu_json Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
const_ Bump crate-ci/typos and fix typos () 2024-04-04 09:59:21 +02:00
eval Exit early when encountering parsing errors () 2023-09-05 14:36:37 +02:00
fixtures Send LSP Completion Item Kind () 2024-03-24 20:14:12 -05:00
hooks Fix hooks on 0.92.0 () 2024-04-04 09:25:54 +02:00
modules Evaluate string interpolation at parse time () 2024-01-22 09:13:48 +02:00
overlays Fix overlay_use_main_not_exported hanging when an external spam command exists () 2023-12-08 06:08:38 -06:00
parsing Ensure currently_parsed_cwd is set for config files () 2024-04-09 10:06:41 -04:00
path ls, rm, cp, open, touch, mkdir: Don't expand tilde if input path is quoted string or a variable. () 2024-03-25 10:08:38 +08:00
plugin_persistence Merge stream_example into example plugin and clean up names () 2024-03-19 12:36:46 -05:00
plugins Local socket mode and foreground terminal control for plugins () 2024-04-15 18:28:18 +00:00
scope add $.extra_usage to modules () 2024-01-27 17:49:21 +02:00
shell Improve with-env robustness () 2024-04-16 19:08:58 +08:00
main.rs Keep plugins persistently running in the background () 2024-03-09 17:10:22 -06:00