3 \m@s:ddlZddlZddlZddlZddZedkr6edS)Nc "Cs d}d}tj||d}|jddtjdd|jddtjd d d|jd d d dd|j}|jphtj}|jpttj }|j }|Vy$|rt j |}nt j |t jd}Wn*tk r}zt|WYdd}~XnXWdQRX|"t j|||dd|jdWdQRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)prog descriptioninfile?z-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)Zobject_pairs_hook) sort_keysindent )argparseArgumentParser add_argumentZFileType parse_argsrsysstdinr stdoutrjsonload collections OrderedDict ValueError SystemExitdumpwrite) rrparserZoptionsrr robjer$!/usr/lib64/python3.6/json/tool.pymains0    $r&__main__)rrrrr&__name__r$r$r$r% s