B
    v9a                 @   s2   d dl Z d dlZd dlZdd Zedkr.e  dS )    Nc        	      C   s   d} d}t j| |d}|jddt  dd |jddt d	d
d |jddddd | }|jphtj}|jpttj	}|j
}|@ yt|}W n* tk
r } zt|W d d }~X Y nX W d Q R X |" tj|||dd |d W d Q R X d S )Nzpython -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      )	sort_keysindent
)argparseArgumentParseradd_argumentFileType
parse_argsr   sysstdinr	   stdoutr   jsonload
ValueError
SystemExitdumpwrite)	r   r   parseroptionsr   r	   r   obje r$   /usr/lib/python3.7/tool.pymain   s*    
$r&   __main__)r   r   r   r&   __name__r$   r$   r$   r%   <module>   s
   