#!/usr/bin/python3 # -*- coding: utf-8 -*- from __future__ import print_function import sys import os.path import json import jsonpatch import argparse parser = argparse.ArgumentParser(description='Diff two JSON files') parser.add_argument('FILE1', type=argparse.FileType('r')) parser.add_argument('FILE2', type=argparse.FileType('r')) parser.add_argument('--indent', type=int, default=None, help='Indent output by n spaces') parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + jsonpatch.__version__) def main(): try: diff_files() except KeyboardInterrupt: sys.exit(1) def diff_files(): """ Diffs two JSON files and prints a patch """ args = parser.parse_args() doc1 = json.load(args.FILE1) doc2 = json.load(args.FILE2) patch = jsonpatch.make_patch(doc1, doc2) if patch.patch: print(json.dumps(patch.patch, indent=args.indent)) sys.exit(1) if __name__ == "__main__": main()
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
README | File | 100 B | 0644 |
|
aclocal | File | 35.93 KB | 0755 |
|
aclocal.1.gz | File | 1.18 KB | 0644 |
|
automake | File | 247.38 KB | 0755 |
|
automake.1.gz | File | 1.57 KB | 0644 |
|
awk | File | 642.65 KB | 0755 |
|
awk.1.gz | File | 28.17 KB | 0644 |
|
builtins.7.gz | File | 508 B | 0644 |
|
c++ | File | 1022.94 KB | 0755 |
|
c++.1.gz | File | 297.02 KB | 0644 |
|
c89 | File | 428 B | 0755 |
|
c89.1.gz | File | 1.33 KB | 0644 |
|
c99 | File | 454 B | 0755 |
|
c99.1.gz | File | 1.39 KB | 0644 |
|
cc | File | 1022.94 KB | 0755 |
|
cc.1.gz | File | 297.02 KB | 0644 |
|
cpp | File | 1022.94 KB | 0755 |
|
desktop-background | File | 13.66 KB | 0644 |
|
desktop-background.xml | File | 643 B | 0644 |
|
desktop-grub | File | 154.66 KB | 0644 |
|
desktop-splash | File | 309.33 KB | 0644 |
|
editor | File | 240.11 KB | 0755 |
|
editor.1.gz | File | 5.34 KB | 0644 |
|
ex | File | 2.55 MB | 0755 |
|
ex.1.gz | File | 5.29 KB | 0644 |
|
ex.fr.1.gz | File | 6.37 KB | 0644 |
|
ex.it.1.gz | File | 5.96 KB | 0644 |
|
ex.ja.1.gz | File | 5.79 KB | 0644 |
|
ex.pl.1.gz | File | 6.15 KB | 0644 |
|
ex.ru.1.gz | File | 6.96 KB | 0644 |
|
faked.1.gz | File | 1.16 KB | 0644 |
|
faked.es.1.gz | File | 1.42 KB | 0644 |
|
faked.fr.1.gz | File | 1.49 KB | 0644 |
|
faked.sv.1.gz | File | 1.32 KB | 0644 |
|
fakeroot | File | 3.76 KB | 0755 |
|
fakeroot.1.gz | File | 3.91 KB | 0644 |
|
fakeroot.es.1.gz | File | 4.38 KB | 0644 |
|
fakeroot.fr.1.gz | File | 4.59 KB | 0644 |
|
fakeroot.sv.1.gz | File | 4.26 KB | 0644 |
|
from | File | 9.99 KB | 0755 |
|
from.1.gz | File | 1.43 KB | 0644 |
|
ftp | File | 98.7 KB | 0755 |
|
ftp.1.gz | File | 9.02 KB | 0644 |
|
futurize | File | 384 B | 0755 |
|
infobrowser | File | 245.72 KB | 0755 |
|
infobrowser.1.gz | File | 1.4 KB | 0644 |
|
jsondiff | File | 1018 B | 0755 |
|
jsonpatch | File | 3.58 KB | 0755 |
|
jsonpointer | File | 1.31 KB | 0755 |
|
jsonschema | File | 398 B | 0755 |
|
locate | File | 42.08 KB | 2755 |
|
locate.1.gz | File | 2.58 KB | 0644 |
|
lzcat | File | 74.36 KB | 0755 |
|
lzcat.1.gz | File | 19.87 KB | 0644 |
|
lzcmp | File | 6.48 KB | 0755 |
|
lzcmp.1.gz | File | 664 B | 0644 |
|
lzdiff | File | 6.48 KB | 0755 |
|
lzdiff.1.gz | File | 664 B | 0644 |
|
lzegrep | File | 5.76 KB | 0755 |
|
lzegrep.1.gz | File | 700 B | 0644 |
|
lzfgrep | File | 5.76 KB | 0755 |
|
lzfgrep.1.gz | File | 700 B | 0644 |
|
lzgrep | File | 5.76 KB | 0755 |
|
lzgrep.1.gz | File | 700 B | 0644 |
|
lzless | File | 1.76 KB | 0755 |
|
lzless.1.gz | File | 743 B | 0644 |
|
lzma | File | 74.36 KB | 0755 |
|
lzma.1.gz | File | 19.87 KB | 0644 |
|
lzmore | File | 2.11 KB | 0755 |
|
lzmore.1.gz | File | 636 B | 0644 |
|
mt | File | 78.63 KB | 0755 |
|
mt.1.gz | File | 1.98 KB | 0644 |
|
my.cnf | File | 1.28 KB | 0644 |
|
nawk | File | 642.65 KB | 0755 |
|
nawk.1.gz | File | 28.17 KB | 0644 |
|
nc | File | 34.48 KB | 0755 |
|
nc.1.gz | File | 6.12 KB | 0644 |
|
netcat | File | 34.48 KB | 0755 |
|
netcat.1.gz | File | 6.12 KB | 0644 |
|
netrc.5.gz | File | 2.04 KB | 0644 |
|
newt-palette | File | 160 B | 0644 |
|
pager | File | 166.76 KB | 0755 |
|
pager.1.gz | File | 20.01 KB | 0644 |
|
pasteurize | File | 388 B | 0755 |
|
pbr | File | 152 B | 0755 |
|
pftp | File | 98.7 KB | 0755 |
|
pftp.1.gz | File | 9.02 KB | 0644 |
|
phar | File | 14.47 KB | 0755 |
|
phar.1.gz | File | 2.74 KB | 0644 |
|
phar.phar | File | 14.47 KB | 0755 |
|
phar.phar.1.gz | File | 36 B | 0644 |
|
php | File | 4.68 MB | 0755 |
|
php.1.gz | File | 3.54 KB | 0644 |
|
pico | File | 240.11 KB | 0755 |
|
pico.1.gz | File | 5.34 KB | 0644 |
|
pinentry | File | 62.49 KB | 0755 |
|
pinentry.1.gz | File | 1.38 KB | 0644 |
|
rcp | File | 98.14 KB | 0755 |
|
rcp.1.gz | File | 2.35 KB | 0644 |
|
rlogin | File | 710.79 KB | 0755 |
|
rlogin.1.gz | File | 14.25 KB | 0644 |
|
rmt | File | 58.39 KB | 0755 |
|
rmt.8.gz | File | 2.34 KB | 0644 |
|
rsh | File | 710.79 KB | 0755 |
|
rsh.1.gz | File | 14.25 KB | 0644 |
|
rview | File | 2.55 MB | 0755 |
|
rvim | File | 2.55 MB | 0755 |
|
shimx64.efi.signed | File | 937.96 KB | 0644 |
|
telnet | File | 108.42 KB | 0755 |
|
telnet.1.gz | File | 8.8 KB | 0644 |
|
text.plymouth | File | 205 B | 0644 |
|
traceroute6 | File | 18.02 KB | 4755 |
|
traceroute6.8.gz | File | 925 B | 0644 |
|
unlzma | File | 74.36 KB | 0755 |
|
unlzma.1.gz | File | 19.87 KB | 0644 |
|
updatedb | File | 46.08 KB | 0755 |
|
updatedb.8.gz | File | 2.08 KB | 0644 |
|
vi | File | 2.55 MB | 0755 |
|
vi.1.gz | File | 5.29 KB | 0644 |
|
vi.fr.1.gz | File | 6.37 KB | 0644 |
|
vi.it.1.gz | File | 5.96 KB | 0644 |
|
vi.ja.1.gz | File | 5.79 KB | 0644 |
|
vi.pl.1.gz | File | 6.15 KB | 0644 |
|
vi.ru.1.gz | File | 6.96 KB | 0644 |
|
view | File | 2.55 MB | 0755 |
|
view.1.gz | File | 5.29 KB | 0644 |
|
view.fr.1.gz | File | 6.37 KB | 0644 |
|
view.it.1.gz | File | 5.96 KB | 0644 |
|
view.ja.1.gz | File | 5.79 KB | 0644 |
|
view.pl.1.gz | File | 6.15 KB | 0644 |
|
view.ru.1.gz | File | 6.96 KB | 0644 |
|
vim | File | 2.55 MB | 0755 |
|
vimdiff | File | 2.55 MB | 0755 |
|
vtrgb | File | 158 B | 0644 |
|
w | File | 18.07 KB | 0755 |
|
w.1.gz | File | 1.25 KB | 0644 |
|
write | File | 13.99 KB | 2755 |
|
write.1.gz | File | 1.8 KB | 0644 |
|
x-cursor-theme | File | 30 B | 0644 |
|
x-session-manager | File | 2.9 KB | 0755 |
|
x-session-manager.1.gz | File | 582 B | 0644 |
|
x-terminal-emulator | File | 2.36 KB | 0755 |
|
x-terminal-emulator.1.gz | File | 1.2 KB | 0644 |
|
x-window-manager | File | 382.26 KB | 0755 |
|
x-window-manager.1.gz | File | 698 B | 0644 |
|