nushell/crates/nu-command/src/env
Antoine Stevan 88e07b5ea4
DOCUMENTATION: add a new "key-value" example to with-env (#8119)
hello there 👋 😋 

when messing around with `with-env`, looking at the examples, i did not
understand that we could directly run `with-env` with a record as the
argument and not from the input of a pipe 😮

even though the last example, i.e. 
```bash
  Set by row(e.g. `open x.json` or `from json`)
  > '{"X":"Y","W":"Z"}'|from json|with-env $in { [$env.X $env.W] }
```
, is equivalent, just the record comes from the pipe, i thought adding
that explicite new example could be helpful 😌
 
# Description
looking at the single real change of this PR, i.e. 86ef34e90, you can
see i've simply added
```bash
  Set by key-value record
  > with-env {X: "Y", W: "Z"} { [$env.X $env.W] }
```
just before the example above

> **Note**
> i've also added spaces around the '|' in the last examples, from
> ```bash
>   > '{"X":"Y","W":"Z"}'|from json|with-env $in { [$env.X $env.W] }
> ```
> to
> ```bash
>   > '{"X":"Y","W":"Z"}' | from json | with-env $in { [$env.X $env.W] }
> ```
> hopefully making the pipeline a bit easier to read 👍

### hope you like that 😏 

# User-Facing Changes
a new example has been added to `with-env`

# Tests + Formatting
no tests have been added

# After Submitting
the change should not affect the website, i think

=> if i need to generate the associated `HTML` file on
https://github.com/nushell/nushell.github.io, please tell me 😋
2023-02-19 18:28:49 +00:00
..
config Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
env_command.rs Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
export_env.rs Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
let_env.rs Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
load_env.rs Load env pwd (#7963) 2023-02-05 23:40:46 +01:00
mod.rs Move from source to source-env (#6277) 2022-09-01 08:32:56 +12:00
source_env.rs ensure that when nu evaluates files, it allows early returns (#7415) 2023-02-02 00:02:27 +01:00
with_env.rs DOCUMENTATION: add a new "key-value" example to with-env (#8119) 2023-02-19 18:28:49 +00:00