forked from extern/nushell
2aa5c2c41f
### What? This change removes 3 flags (`--all`, `--both`, and `--format`) from `str trim`. This is a net reduction of ~450 LoC and `str trim` no longer depends on `fancy_regex`. ### Why? I found these flags to be quite confusing when reviewing `str trim` earlier today: 1. `--all` removes characters even if they're in the centre of the the string. - This is arguably not "trimming"! In all programming languages I'm familiar with, trimming only affects the start and end of a string. - If someone needs to do this, `str replace` is more natural IMO 2. `--both` trims from the left and right - Confusing and unnecessary given that this is also the default behaviour 3. `--format` replaces multiple spaces with a single space, even in the centre of the string - Again, I don't think this falls under the scope of "trimming". IMO `str replace` is a more natural fit I believe that `str trim` is simpler and easier to understand after this change. ### Before ``` 〉help str trim Trim whitespace or specific character Search terms: whitespace, strip, lstrip, rstrip Usage: > str trim {flags} ...(rest) Flags: -h, --help - Display the help message for this command -c, --char <String> - character to trim (default: whitespace) -l, --left - trims characters only from the beginning of the string -r, --right - trims characters only from the end of the string -a, --all - trims all characters from both sides of the string *and* in the middle -b, --both - trims all characters from left and right side of the string -f, --format - trims spaces replacing multiple characters with singles in the middle ``` ### After ``` 〉help str trim Trim whitespace or specific character Search terms: whitespace, strip, lstrip, rstrip Usage: > str trim {flags} ...(rest) Flags: -h, --help - Display the help message for this command -c, --char <String> - character to trim (default: whitespace) -l, --left - trims characters only from the beginning of the string -r, --right - trims characters only from the end of the string ``` |
||
---|---|---|
.. | ||
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-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 | ||
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.