nushell/crates/nu-command
Andrés N. Robalino c9c6bd4836
Create errors from tables. (#3986)
```
> [
  [          msg,                 labels,                      span];
  ["The message", "Helpful message here", ([[start, end]; [0, 141]])]
] | error make

error: The message
  ┌─ shell:1:1
  │
1 │ ╭ [
2 │ │   [          msg,                 labels,                      span];
3 │ │   ["The message", "Helpful message here", ([[start, end]; [0, 141]])]
  │ ╰─────────────────────────────────────────────────────────────────────^ Helpful message here
```

Adding a more flexible approach for creating error values. One use case, for instance is the
idea of a test framework. A failed assertion instead of printing to the screen it could create
tables with more details of the failed assertion and pass it to this command for making a full
fledge error that Nu can show. This can (and should) be extended for capturing error values as well
in the pipeline. One could also use it for inspection.

For example: `.... | error inspect { # inspection here }`

or "error handling" as well, like so: `.... | error capture { fix here }`

However, we start here only with `error make` that creates an error value for you with limited support for the time being.
2021-09-02 21:07:26 -05:00
..
assets nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
src Create errors from tables. (#3986) 2021-09-02 21:07:26 -05:00
tests Add subcommand into filesize (#3987) 2021-09-02 18:19:54 -05:00
build.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
Cargo.toml Move sys, ps, fetch, post to internal commands (#3983) 2021-09-01 14:29:09 +12:00
README.md Begin directory contrib docs and split commands (#3650) 2021-06-19 12:06:44 +12:00

nu-command

The Nu command crate contains the full set of internal commands, that is, the commands that can be form the set of built-in commands in a Nushell engine.

The default set of commands that Nushell ships with can be found in the default context.

The commands themselves live in the commands module.