mirror of
https://github.com/nushell/nushell.git
synced 2025-06-08 11:06:55 +02:00
# Description Simple `parse` patterns let you quickly put together simple parsers, but sometimes you aren't actually interested in some of the output (such as variable whitespace). This PR lets you use `{_}` to discard part of the input. Example: ```nushell "hello world" | parse "{foo} {_}" # => ╭───┬───────╮ # => │ # │ foo │ # => ├───┼───────┤ # => │ 0 │ hello │ # => ╰───┴───────╯ ``` here's a simple parser for the `apropops` using the `_` placeholder to discard the variable whitespace, without needing to resort to a full regex pattern: ```nushell apropos linux | parse "{name} ({section}) {_}- {topic}" # => ╭───┬───────────────────────────────────────┬─────────┬─────────────────────────────────────────────────────────────────────╮ # => │ # │ name │ section │ topic │ # => ├───┼───────────────────────────────────────┼─────────┼─────────────────────────────────────────────────────────────────────┤ # => │ 0 │ PAM │ 8 │ Pluggable Authentication Modules for Linux │ # => │ 1 │ aarch64-linux-gnu-addr2line │ 1 │ convert addresses or symbol+offset into file names and line numbers │ # => │ 2 │ ... │ ... │ ... │ # => │ 3 │ xcb_selinux_set_window_create_context │ 3 │ (unknown subject) │ # => │ 4 │ xorriso-dd-target │ 1 │ Device evaluator and disk image copier for GNU/Linux │ # => ╰───┴───────────────────────────────────────┴─────────┴─────────────────────────────────────────────────────────────────────╯ ``` # User-Facing Changes * `parse` simple patterns can now discard input using `{_}` # Tests + Formatting N/A # After Submitting N/A
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.