B ! @ sf d dl Z d dlZd dlZdd Zedkrby e W n. ek r` Z zeej W ddZ[X Y nX dS ) Nc C s d} d}t j| |d}|jddt jdddd |jd dt jddddd |jd dddd | }|jpptj}|jp|tj }|j }|@ yt|}W n* t k r } zt|W d d }~X Y nX W d Q R X |" tj|||dd |d W d Q R X d S )Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)progdescriptioninfile?zutf-8)encodingz-a JSON file to be validated or pretty-printed)nargstypehelpoutfilewz%write the output of infile to outfilez--sort-keys store_trueFz5sort the output of dictionaries alphabetically by key)actiondefaultr ) sort_keysindent )argparseArgumentParseradd_argumentFileType parse_argsr sysstdinr stdoutr jsonload ValueError SystemExitdumpwrite) r r parseroptionsr r r obje r% ./opt/alt/python37/lib64/python3.7/json/tool.pymain s* $r' __main__) r r r r' __name__BrokenPipeErrorexcexiterrnor% r% r% r&