-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgenerate_readme_examples.sh
executable file
·74 lines (48 loc) · 1.9 KB
/
generate_readme_examples.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env bash
cat << EOF
Getting a full diff of two json files:
$(echo '```diff')
$ jaydiff --show-types old.json new.json
$(./jaydiff --indent=' ' --show-types test_files/lhs.json test_files/rhs.json)
$(echo '```')
Ignoring fields:
$(echo '```diff')
$ jaydiff --show-types \\
--ignore='.b\[\]' --ignore='.d' --ignore='.c.[ac]' \\
old.json new.json
$(./jaydiff --indent=' ' --show-types \
--ignore='.b\[\]' --ignore='.d' --ignore='.c.[ac]' \
test_files/lhs.json test_files/rhs.json
)
$(echo '```')
Report format:
$(echo '```diff')
$ jaydiff --report --show-types old.json new.json
$(./jaydiff --report --indent=' ' --show-types test_files/lhs.json test_files/rhs.json)
$(echo '```')
JSON-like format:
$(echo '```diff')
$ jaydiff --json old.json new.json
$(./jaydiff --json --indent=' ' test_files/lhs.json test_files/rhs.json)
$(echo '```')
Ignore Excess values (useful when checking for backward compatibility):
$(echo '```diff')
$ jaydiff --report --show-types --ignore-excess old.json new.json
$(./jaydiff --report --ignore-excess --indent=' ' --show-types test_files/lhs.json test_files/rhs.json)
$(echo '```')
Ignore values (type must still match):
$(echo '```diff')
$ jaydiff --report --show-types --ignore-excess --ignore-values old.json new.json
$(./jaydiff --report --ignore-excess --ignore-values --indent=' ' --show-types test_files/lhs.json test_files/rhs.json)
$(echo '```')
JSON streams:
$(echo '```diff')
$ jaydiff --stream --json old.json new.json
$(./jaydiff --stream --json --indent=' ' test_files/lhs_stream.json test_files/rhs_stream.json)
$(echo '```')
Validating JSON stream types:
$(echo '```diff')
$ jaydiff --ignore-excess --ignore-values --stream-validate --report --show-types base.json stream.json
$(./jaydiff --ignore-excess --ignore-values --stream-validate --report --show-types test_files/lhs_validate.json test_files/rhs_validate.json)
$(echo '```')
EOF