3 Õì2amã@s:ddlZddlZddlZddlZdd„Zedkr6eƒdS)éNc "Cs d}d}tj||d�}|jddtjƒdd�|jddtjd ƒd d�|jd d d dd�|jƒ}|jphtj}|jpttj }|j }|�Vy$|r”t j |ƒ}nt j |t jd�}Wn*tk rÐ}zt|ƒ‚WYdd}~XnXWdQRX|�"t j|||dd�|jdƒWdQRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)ÚprogÚ descriptionÚinfileú?z-a JSON file to be validated or pretty-printed)ÚnargsÚtypeÚhelpÚoutfileÚwz%write the output of infile to outfilez --sort-keysÚ store_trueFz5sort the output of dictionaries alphabetically by key)ÚactionÚdefaultr)Zobject_pairs_hooké)Ú sort_keysÚindentÚ )ÚargparseÚArgumentParserÚ add_argumentÚFileTypeÚ parse_argsrÚsysÚstdinr ÚstdoutrÚjsonÚloadÚ collectionsÚ OrderedDictÚ ValueErrorÚ SystemExitÚdumpÚwrite) rrÚparserÚoptionsrr rÚobjÚe©r&ú)/opt/alt/python36/lib64/python3.6/tool.pyÚmains0    $r(Ú__main__)rrrrr(Ú__name__r&r&r&r'Ú s