mirror of
https://github.com/nushell/nushell
synced 2024-12-26 13:03:07 +00:00
680405e527
hellord 👋 😋 # Description this PR fixes the format of a few single-line examples and the indentation of some multi-line examples - single-line example formatting - `compact` - multi-line example indentation - `update cells` - `error make - `split-by` # User-Facing Changes - `compact` from ```bash Examples: Filter out all records where 'Hello' is null (returns nothing) > [["Hello" "World"]; [null 3]]| compact Hello Filter out all records where 'World' is null (Returns the table) > [["Hello" "World"]; [null 3]]| compact World ``` to ```bash Examples: Filter out all records where 'Hello' is null (returns nothing) > [["Hello" "World"]; [null 3]] | compact Hello Filter out all records where 'World' is null (Returns the table) > [["Hello" "World"]; [null 3]] | compact World ``` - `update cells` from ```bash Examples: Update the zero value cells to empty strings. > [ ["2021-04-16", "2021-06-10", "2021-09-18", "2021-10-15", "2021-11-16", "2021-11-17", "2021-11-18"]; [ 37, 0, 0, 0, 37, 0, 0] ] | update cells { |value| if $value == 0 { "" } else { $value } } Update the zero value cells to empty strings in 2 last columns. > [ ["2021-04-16", "2021-06-10", "2021-09-18", "2021-10-15", "2021-11-16", "2021-11-17", "2021-11-18"]; [ 37, 0, 0, 0, 37, 0, 0] ] | update cells -c ["2021-11-18", "2021-11-17"] { |value| if $value == 0 { "" } else { $value } } ``` to ```bash Examples: Update the zero value cells to empty strings. > [ ["2021-04-16", "2021-06-10", "2021-09-18", "2021-10-15", "2021-11-16", "2021-11-17", "2021-11-18"]; [ 37, 0, 0, 0, 37, 0, 0] ] | update cells { |value| if $value == 0 { "" } else { $value } } Update the zero value cells to empty strings in 2 last columns. > [ ["2021-04-16", "2021-06-10", "2021-09-18", "2021-10-15", "2021-11-16", "2021-11-17", "2021-11-18"]; [ 37, 0, 0, 0, 37, 0, 0] ] | update cells -c ["2021-11-18", "2021-11-17"] { |value| if $value == 0 { "" } else { $value } } ``` - `split-by` from ```bash Examples: split items by column named "lang" > { '2019': [ { name: 'andres', lang: 'rb', year: '2019' }, { name: 'jt', lang: 'rs', year: '2019' } ], '2021': [ { name: 'storm', lang: 'rs', 'year': '2021' } ] } | split-by lang ``` to ```bash Examples: split items by column named "lang" > { '2019': [ { name: 'andres', lang: 'rb', year: '2019' }, { name: 'jt', lang: 'rs', year: '2019' } ], '2021': [ { name: 'storm', lang: 'rs', 'year': '2021' } ] } | split-by lang ``` - `error make` from ```bash Examples: Create a custom error for a custom command > def foo [x] { let span = (metadata $x).span; error make {msg: "this is fishy", label: {text: "fish right here", start: $span.start, end: $span.end } } } Create a simple custom error for a custom command > def foo [x] { error make {msg: "this is fishy"} } ``` to ```bash Examples: Create a custom error for a custom command > def foo [x] { let span = (metadata $x).span; error make {msg: "this is fishy", label: {text: "fish right here", start: $span.start, end: $span.end } } } Create a simple custom error for a custom command > def foo [x] { error make {msg: "this is fishy"} } ``` # Tests + Formatting no tests have been changed => this is a pure formatting PR - ✔️ `cargo fmt --all` - ✔️ `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` - ✔️ `cargo test --workspace` # After Submitting need to change the book? 🤔 |
||
---|---|---|
.. | ||
nu-cli | ||
nu-cmd-lang | ||
nu-color-config | ||
nu-command | ||
nu-engine | ||
nu-explore | ||
nu-glob | ||
nu-json | ||
nu-parser | ||
nu-path | ||
nu-plugin | ||
nu-pretty-hex | ||
nu-protocol | ||
nu-system | ||
nu-table | ||
nu-term-grid | ||
nu-test-support | ||
nu-utils | ||
nu_plugin_custom_values | ||
nu_plugin_example | ||
nu_plugin_formats | ||
nu_plugin_gstat | ||
nu_plugin_inc | ||
nu_plugin_python | ||
nu_plugin_query | ||
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.