forked from extern/nushell
5886a74ccc
# Description The `into binary` command has a `-c` flag which strips any leading 0s in the most significant digits to represent the minimal number of bytes, rather than the system's complete in-memory representation of the input. However, currently giving 0 as input results in eight 0 bytes even with the `-c` flag, which is inconsistent with the purpose of the flag. ```nu ❯ : 345678 | into binary Length: 8 (0x8) bytes | printable whitespace ascii_other non_ascii 00000000: 4e 46 05 00 00 00 00 00 NF•00000 ❯ : 345678 | into binary -c Length: 3 (0x3) bytes | printable whitespace ascii_other non_ascii 00000000: 4e 46 05 ❯ : 0 | into binary Length: 8 (0x8) bytes | printable whitespace ascii_other non_ascii 00000000: 00 00 00 00 00 00 00 00 00000000 ❯ : 0 | into binary -c Length: 8 (0x8) bytes | printable whitespace ascii_other non_ascii 00000000: 00 00 00 00 00 00 00 00 00000000 ``` This change fixes this behavior so that if the entire input results in all 0 bytes, only a single 0 byte is returned. ```nu ❯ : ~/src/nushell/target/aarch64-linux-android/debug/nu -c '0 | into binar y -c' Length: 1 (0x1) bytes | printable whitespace ascii_other non_ascii 00000000: 00 ``` # User-Facing Changes Values which result in all null bytes will be truncated to a single byte when `-c` is given. This could potentially be considered a breaking change if this behavior was relied upon in some way. |
||
---|---|---|
.. | ||
nu_plugin_custom_values | ||
nu_plugin_example | ||
nu_plugin_formats | ||
nu_plugin_gstat | ||
nu_plugin_inc | ||
nu_plugin_python | ||
nu_plugin_query | ||
nu-cli | ||
nu-cmd-base | ||
nu-cmd-dataframe | ||
nu-cmd-extra | ||
nu-cmd-lang | ||
nu-color-config | ||
nu-command | ||
nu-engine | ||
nu-explore | ||
nu-glob | ||
nu-json | ||
nu-lsp | ||
nu-parser | ||
nu-path | ||
nu-plugin | ||
nu-pretty-hex | ||
nu-protocol | ||
nu-std | ||
nu-system | ||
nu-table | ||
nu-term-grid | ||
nu-test-support | ||
nu-utils | ||
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.