forked from extern/nushell
c9c6bd4836
``` > [ [ 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. |
||
---|---|---|
.. | ||
assets | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml | ||
README.md |
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.