mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 00:13:21 +01:00
1514b9fbef
# Description Fixes: #13189 The issue is caused `error make` returns a `Value::Errror`, and when nushell pass it to `table -e` in `std help`, it directly stop and render the error message. To solve it, I think it's safe to make these examples return None directly, it doesn't change the reult of `help error make`. # User-Facing Changes ## Before ```nushell ~> help "error make" Error: nu:🐚:eval_block_with_input × Eval block failed with pipeline input ╭─[NU_STDLIB_VIRTUAL_DIR/std/help.nu:692:21] 691 │ ] { 692 │ let commands = (scope commands | sort-by name) · ───────┬────── · ╰── source value 693 │ ╰──── Error: × my custom error message ``` ## After ```nushell Create an error. Search terms: panic, crash, throw Category: core This command: - does not create a scope. - is a built-in command. - is a subcommand. - is not part of a plugin. - is not a custom command. - is not a keyword. Usage: > error make {flags} <error_struct> Flags: -u, --unspanned - remove the origin label from the error -h, --help - Display the help message for this command Signatures: <nothing> | error make[ <record>] -> <any> Parameters: error_struct: <record> The error to create. Examples: Create a simple custom error > error make {msg: "my custom error message"} Create a more complex custom error > error make { msg: "my custom error message" label: { text: "my custom label text" # not mandatory unless $.label exists # optional span: { # if $.label.span exists, both start and end must be present start: 123 end: 456 } } help: "A help string, suggesting a fix to the user" # optional } Create a custom error for a custom command that shows the span of the argument > def foo [x] { error make { msg: "this is fishy" label: { text: "fish right here" span: (metadata $x).span } } } ``` # Tests + Formatting Added 1 test |
||
---|---|---|
.. | ||
nu_plugin_custom_values | ||
nu_plugin_example | ||
nu_plugin_formats | ||
nu_plugin_gstat | ||
nu_plugin_inc | ||
nu_plugin_nu_example | ||
nu_plugin_polars | ||
nu_plugin_python | ||
nu_plugin_query | ||
nu_plugin_stress_internals | ||
nu-cli | ||
nu-cmd-base | ||
nu-cmd-extra | ||
nu-cmd-lang | ||
nu-cmd-plugin | ||
nu-color-config | ||
nu-command | ||
nu-derive-value | ||
nu-engine | ||
nu-explore | ||
nu-glob | ||
nu-json | ||
nu-lsp | ||
nu-parser | ||
nu-path | ||
nu-plugin | ||
nu-plugin-core | ||
nu-plugin-engine | ||
nu-plugin-protocol | ||
nu-plugin-test-support | ||
nu-pretty-hex | ||
nu-protocol | ||
nu-std | ||
nu-system | ||
nu-table | ||
nu-term-grid | ||
nu-test-support | ||
nu-utils | ||
nuon | ||
README.md |
Nushell core libraries and plugins
These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.
Foundational libraries are split into two kinds of crates:
- Core crates - those crates that work together to build the Nushell language engine
- Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.
Plugins are likewise also split into two types:
- Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
- Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.