Document new string split --no-empty option

This commit is contained in:
Mahmoud Al-Qudsi 2018-03-29 08:23:29 -05:00
parent 999728670d
commit 04b8b35a56
2 changed files with 3 additions and 2 deletions

View file

@ -32,6 +32,7 @@ This section is for changes merged to the `major` branch that are not also merge
- `bind` has a new `--silent` option to ignore bind requests for named keys not available under the current `$TERMINAL` (#4188, #4431)
- Globs are faster (#4579)
- `string` reads from stdin faster (#4610)
- `string split` supports `-n/--no-empty` to exclude empty strings from the result (#4779)
- `cd` tab completions no longer descend into the deepest unambiguous path (#4649)
- Setting `$PATH` no longer warns on non-existent directories, allowing for a single $PATH to be shared across machines (e.g. via dotfiles).
- `funced` now has a `-s` and `--save` option to automatically save the edited function after successfully editing (#4668).

View file

@ -12,7 +12,7 @@ string repeat [(-n | --count) COUNT] [(-m | --max) MAX] [(-N | --no-newline)]
[(-q | --quiet)] [STRING...]
string replace [(-a | --all)] [(-f | --filter)] [(-i | --ignore-case)] [(-r | --regex)]
[(-q | --quiet)] PATTERN REPLACEMENT [STRING...]
string split [(-m | --max) MAX] [(-r | --right)] [(-q | --quiet)] SEP
string split [(-m | --max) MAX] [(-n | --no-empty)] [(-q | --quiet)] [(-r | --right)] SEP
[STRING...]
string sub [(-s | --start) START] [(-l | --length) LENGTH] [(-q | --quiet)]
[STRING...]
@ -89,7 +89,7 @@ Exit status: 0 if at least one replacement was performed, or 1 otherwise.
\subsection string-split "split" subcommand
`string split` splits each STRING on the separator SEP, which can be an empty string. If `-m` or `--max` is specified, at most MAX splits are done on each STRING. If `-r` or `--right` is given, splitting is performed right-to-left. This is useful in combination with `-m` or `--max`. Exit status: 0 if at least one split was performed, or 1 otherwise.
`string split` splits each STRING on the separator SEP, which can be an empty string. If `-m` or `--max` is specified, at most MAX splits are done on each STRING. If `-r` or `--right` is given, splitting is performed right-to-left. This is useful in combination with `-m` or `--max`. With `-n` or `--no-empty`, empty results are excluded from consideration (e.g. `hello\n\nworld` would expand to two strings and not three). Exit status: 0 if at least one split was performed, or 1 otherwise.
See also `read --delimiter`.