Cylul007 Webshell
Uname
:
Linux ip-172-31-85-249 4.19.0-27-cloud-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64
PHP
:
7.4.16
on
fpm-fcgi
Time
:
27 Dec 2024 18:03:25
Path :
/
bin
/
File Upload :
New File
New Folder
Current File : //bin/jsondiff
Download
HOME
#!/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()
Copyright © 2018 - Powered By CytoXploit