Commit graph

18 commits

Author SHA1 Message Date
ridiculousfish
73c747d162 Add string join0
string join0 joins its arguments using NUL byte, which complements
string split0. For example it allows piping a variable through sort -z.
2018-07-01 15:56:34 -07:00
ridiculousfish
d34a300818 Add string split0
This adds a new string command split0, which splits on zero bytes.
split0 has superpowers because its output is not further split on
newlines when used in command substitutions.
2018-07-01 15:56:33 -07:00
Fabian Homborg
ca897807eb Add some tests for string and NUL 2018-05-28 12:10:40 +02:00
ridiculousfish
6e56637cf0 Remove support for the ? wildcard
Fixes #4520
2018-03-31 16:54:50 -07:00
Kurtis Rader
a4ed0837a1 use new logmsg and set --show in tests 2017-08-04 12:51:48 -07:00
Kurtis Rader
63d601610d implement -nnn style flags in argparse
This implements support for numeric flags without an associated short or
long flag name. This pattern is used by many commands. For example `head
-3 /a/file` to emit the first three lines of the file.

Fixes #4214
2017-07-13 20:36:59 -07:00
Kurtis Rader
f3cb625802 implement string unescape
Fixes #3543
2017-06-23 22:23:01 -07:00
Kurtis Rader
60bca14b37 implement string escape --style=xxx
We need a way to encode arbitrary strings into valid fish variable
names. It would also be nice if we could convert strings to valid URLs
without using the slow and hard to understand `__fish_urlencode` function.
In particular, eliminating the need to manipulate the locale.

Fixes #4150
2017-06-23 22:23:01 -07:00
Kurtis Rader
f6c9bfc0e8 implement string lower and string upper
Fixes #4080
2017-06-10 17:35:25 -07:00
Kurtis Rader
fb54d34788 change string match --filter to --entire
Per discussion in PR#3998 to review adding a `--filter` flag to `string
replace` rename the same flag in the `string match` subcommand to avoid
confusion about the meaning of the flag.
2017-05-01 22:19:58 -07:00
Kurtis Rader
16816a1202 add string replace --filter flag
Fixes #3348
2017-05-01 22:07:30 -07:00
Kurtis Rader
5b6814d6ad add string match --filter flag
Fixes #3957
2017-04-24 21:45:06 -07:00
Kurtis Rader
f0469d829a string repeat of an empty string is an error
Fixes #3898
2017-03-15 13:55:53 -07:00
Greynad
98f4e49669 Add string 'repeat' subcommand
This feature add the ability to repeat a string a given number of times.
For example: string repeat -n 3 foo
2017-03-12 20:30:36 -07:00
Fabian Homborg
8d6735cb41 Make string match -rnv work
Fixes #3098.
2016-05-31 23:24:08 +02:00
Aaron Gyes
790c7f80c7 Implement an --invert/-v for string match, like grep -v.
Only lines that do not match the pattern are shown.
2016-04-08 10:49:29 +08:00
Michael Steed
5b0996fd80 make fish compatible with pcre2 10.21
pcre2_substitute() now sets the output buffer length to PCRE2_UNSET (~0)
if the output buffer is determined to be too small. This change keeps
track of the buffer size separately where pcre2 can't touch it.

A better fix would be to let pcre2 tell fish what size buffer it needs.
This can be done with PCRE2_SUBSTITUTE_OVERFLOW_LENGTH, but this
requires pcre2 10.21 or later (released January 12), which may be too
new to introduce as a dependency at this point.

Fixes #2743
2016-02-21 19:32:08 -08:00
David Adam
0b3406bdc0 tests/string.in: add tests for string builtin 2015-10-09 11:27:18 +08:00