1- # ` ZSH-STRING-LIB `
2-
3- <!-- START doctoc generated TOC please keep comment here to allow auto update -->
4- <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
5-
6- - [ Introduction] ( #introduction )
7- - [ List Of The Functions] ( #list-of-the-functions )
8- - [ @str-parse-json ] ( #str-parse-json )
9- - [ @str-read-all ] ( #str-read-all )
10- - [ @str-ng-match ] ( #str-ng-match )
11- - [ @str-ng-matches ] ( #str-ng-matches )
12- - [ @str-read-ini ] ( #str-read-ini )
13- - [ @str-read-toml ] ( #str-read-toml )
14- - [ @str-dump ] ( #str-dump )
15-
16- <!-- END doctoc generated TOC please keep comment here to allow auto update -->
1+ <h1 > Zsh String Lib </h1 >
172
183# Introduction
194
@@ -28,37 +13,37 @@ Parses the buffer (`$1`) with JSON and returns:
28131 . Fields for the given key (` $2 ` ) in the given hash (` $3 ` ).
29142 . The hash looks like follows:
3015
31- ``` txt
32- 1/1 → strings at the level 1 of the 1st object
33- 1/2 → strings at the level 1 of the 2nd object
34- …
35- 2/1 → strings at 2nd level of the 1st object
36- …
37- ```
16+ ``` txt
17+ 1/1 → strings at the level 1 of the 1st object
18+ 1/2 → strings at the level 1 of the 2nd object
19+ …
20+ 2/1 → strings at 2nd level of the 1st object
21+ …
22+ ```
3823
39- The strings are parseable with `"${(@Q)${(@z)value}"`, i.e.:
40- they're concatenated and quoted strings found in the JSON.
24+ The strings are parseable with ` "${(@Q)${(@z)value}" ` , i.e.:
25+ they're concatenated and quoted strings found in the JSON.
4126
4227Example:
4328
4429``` json
4530{
46- "zplugin-ices":{
47- "default":{
48- "wait":"1",
49- "lucid":"",
50- "as":"program",
51- "pick":"fzy",
52- "make":"",
53- },
54- "bgn":{
55- "wait":"1",
56- "lucid":"",
57- "as":"null",
58- "make":"",
59- "sbin":"fzy;contrib/fzy-*"
60- }
31+ "zplugin-ices" : {
32+ "default" : {
33+ "wait" : " 1" ,
34+ "lucid" : " " ,
35+ "as" : " program" ,
36+ "pick" : " fzy" ,
37+ "make" : " "
38+ },
39+ "bgn" : {
40+ "wait" : " 1" ,
41+ "lucid" : " " ,
42+ "as" : " null" ,
43+ "make" : " " ,
44+ "sbin" : " fzy;contrib/fzy-*"
6145 }
46+ }
6247}
6348```
6449
@@ -107,8 +92,7 @@ Arguments:
10792Consumes whole data from given file descriptor and stores the string under the
10893given (`$2`) parameter, which is `REPLY` by default.
10994
110- The reason to create this function is speed – it' s much faster than ` read -d
111- ' ' ` .
95+ The reason to create this function is speed – it' s much faster than ` read -d ' ' ` .
11296
11397It can try hard to read the whole data by retrying multiple times (` 10` by
11498default) and sleeping before each retry (not done by default).
@@ -159,7 +143,7 @@ strings.
159143Input:
160144
161145- ` $1 ` … ` $n -1` - the strings to match in,
162- - ` $n ` - the pattern to match in the strings.
146+ - ` $n ` - the pattern to match in the strings.
163147
164148Return value:
165149
@@ -271,6 +255,4 @@ Output:
271255```
272256a\ key: a\ value
273257key: value
274- ````
275-
276- <!-- vim:set ft=markdown tw=80 fo+=an1 autoindent: -->
258+ ```
0 commit comments