mirror of
https://github.com/nushell/nushell.git
synced 2025-07-21 08:01:38 +02:00
# Description This script as example for demonstration ```nushell def miku [] { print "Hiii world! 初音ミクはみんなのことが大好きだよ!" } def main [leek: int, fn: closure] { print $"Miku has ($leek) leeks 🩵" do $fn } ``` --- `escape_for_string_arg` quoting strings misses, where `|` and `;` did split the command into 2+ commands ```console ~:► nu ./miku.nu '32' '{miku}' Miku has 32 leeks 🩵 Hiii world! 初音ミクはみんなのことが大好きだよ! ~:► nu ./miku.nu '32' '{miku};ls|' where type == dir Miku has 32 leeks 🩵 Hiii world! 初音ミクはみんなのことが大好きだよ! ╭────┬─────────────┬──────┬────────┬──────────────╮ │ # │ name │ type │ size │ modified │ ├────┼─────────────┼──────┼────────┼──────────────┤ │ 0 │ Desktop │ dir │ 4.0 kB │ 5 months ago │ │ 1 │ Documents │ dir │ 4.0 kB │ a day ago │ │ 2 │ Downloads │ dir │ 4.0 kB │ a day ago │ │ 3 │ Music │ dir │ 4.0 kB │ 9 months ago │ │ 4 │ Pictures │ dir │ 4.0 kB │ 3 weeks ago │ │ 5 │ Public │ dir │ 4.0 kB │ 9 months ago │ │ 6 │ Templates │ dir │ 4.0 kB │ 3 months ago │ │ 7 │ Videos │ dir │ 4.0 kB │ 9 months ago │ │ 8 │ __pycache__ │ dir │ 4.0 kB │ 3 weeks ago │ │ 9 │ bin │ dir │ 4.0 kB │ 3 days ago │ │ 10 │ repos │ dir │ 4.0 kB │ a day ago │ │ 11 │ trash │ dir │ 4.0 kB │ 3 days ago │ ╰────┴─────────────┴──────┴────────┴──────────────╯ ``` # User-Facing Changes This adjustment won't need a change, aside from clarifying the following behavior, which is unintuitive and potentially ambiguous ```console ~:► nu ./miku.nu '32' {miku} Miku has 32 leeks 🩵 Hiii world! 初音ミクはみんなのことが大好きだよ! ~:► nu ./miku.nu '32' { miku } Error: nu::parser::parse_mismatch × Parse mismatch during operation. ╭─[<commandline>:1:9] 1 │ main 32 "{ miku }" · ─────┬──── · ╰── expected block, closure or record ╰──── ~:► nu ./miku.nu '32' '{' miku '}' Miku has 32 leeks 🩵 Hiii world! 初音ミクはみんなのことが大好きだよ! ```
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.