Skip to content

Commit 4421ea2

Browse files
committed
deleted: .pre-commit-config.yaml
modified: Makefile renamed: README.md -> docs/README.md modified: tests/main.zunit
1 parent 2663690 commit 4421ea2

File tree

4 files changed

+31
-65
lines changed

4 files changed

+31
-65
lines changed

.pre-commit-config.yaml

-14
This file was deleted.

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ check: test
22

33
test:
44
@command -v zunit >/dev/null && \
5-
{ zunit; ((1)); } || \
6-
echo "Please install zunit to run the tests (https://github.com/zunit-zsh/zunit)"
5+
{ zunit; ((1)); } || \
6+
echo "Please install zunit to run the tests (https://github.com/zunit-zsh/zunit)"

README.md renamed to docs/README.md

+28-46
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
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:
2813
1. Fields for the given key (`$2`) in the given hash (`$3`).
2914
2. 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

4227
Example:
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:
10792
Consumes whole data from given file descriptor and stores the string under the
10893
given (`$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
11397
It can try hard to read the whole data by retrying multiple times (`10` by
11498
default) and sleeping before each retry (not done by default).
@@ -159,7 +143,7 @@ strings.
159143
Input:
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
164148
Return value:
165149
@@ -271,6 +255,4 @@ Output:
271255
```
272256
a\ key: a\ value
273257
key: value
274-
````
275-
276-
<!-- vim:set ft=markdown tw=80 fo+=an1 autoindent: -->
258+
```

tests/main.zunit

+1-3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,4 @@
101101
assert "$TOML[<6>_7]" same_as "8 9 \\&10"
102102
assert "$TOML[<11>_12]" same_as "13, \"14\", '15'"
103103
assert "${#TOML}" same_as "6"
104-
}
105-
106-
# vim:ft=zsh:sw=4:sts=4:et
104+
}

0 commit comments

Comments
 (0)